MathsReadCompetitive mathematics
Algorithmic puzzle · integer answermedium50 min

Linear congruential jump

Modular Arithmetic

Define x_0 = 37 and x_(n+1) = (61*x_n + 17) mod 1000003. Calculate x_200000.

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

Treat the affine update as a function. Repeatedly compose it, or iterate while reducing every update. For a faster jump, represent composition by pairs (a,b) for ax+b modulo m.

Worked example with different values

With f(x)=2x+1 modulo 9, f(f(x))=4x+3 modulo 9. Starting at 1 gives 3, then 7.

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 →