Algorithmic puzzle · integer answereasy25 min
GCD checksum
Divisor Arithmetic
Compute S = gcd(1,840)+gcd(2,840)+...+gcd(50000,840). Submit S modulo 1000003.
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.
How to approach this problem
Group inputs by their exact gcd with the fixed integer. For each divisor d, gcd(n,m)=d precisely when n/d is coprime to m/d; this condition repeats every m/d values.
Worked example with different values
For m=6, gcds of 1 through 6 are 1,2,3,2,1,6, with total 15. The same block repeats.
Apply the same reasoning to the challenge. This example is a separate practice problem.
Learn the technique: Number theory: divisors, gcd and modular arithmetic