MathsReadCompetitive mathematics
Algorithmic puzzle · integer answerhard90 min

Coprime digit-sum filter

Divisor Arithmetic

Sum all integers n from 1 through 200000 for which gcd(n,2310)=1 and the sum of the decimal digits of n is divisible by 5. Return the total 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.

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

How to approach this problem

Factor the fixed gcd modulus or compute gcd directly for each candidate. Apply the digit-sum test independently, and accumulate qualifying original integers instead of their digit sums.

Worked example with different values

For modulus 6, 35 is coprime because neither 2 nor 3 divides it. Its digit sum is 8.

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 →