MathsReadCompetitive mathematics
Algorithmic puzzle · integer answermedium50 min

Quadratic orbit checkpoint

Recursive Sequences

Set x_0=1 and x_n=(x_(n-1)^2+37) mod 65521 for n>=1. How many indices n in 1..100000 satisfy x_n divisible by 11?

Solve using mathematics, algorithms, or your own code offline. Submit only the final integer here—no program, expression, graph, or written proof.

Check your answer without signing in. Sign in to save your progress.

Accepted format: a whole number such as 42 or 123456789. No commas, formulas, or source code.

How to approach this problem

Iterate the modular map and count qualifying checkpoints after the update, not at index zero. If a residue repeats, split the orbit into its initial tail, repeating cycle and final partial cycle.

Worked example with different values

For f(x)=x² mod 5 starting at 2, the subsequent states are 4,1,1,…; the repeating cycle begins at 1, not at the initial state.

Apply the same reasoning to the challenge. This example is a separate practice problem.

Learn the technique: Number theory: divisors, gcd and modular arithmetic

Report a question or explanation issue

Back to problems →