Maths Olympiad Prep

Library / /26 of 68

, 2017

Number theory Difficulty 5.0 AIME, harder Prove it United States

Problem:
For positive integers aa and NN, let r(a,N){0,1,,N1}r(a, N) \in \{0,1, \ldots, N-1\} denote the remainder of aa when divided by NN. Determine the number of positive integers n1000000n \leq 1000000 for which
r(n,1000)>r(n,1001) r(n, 1000)>r(n, 1001)

Solution

Solution:
Answer: 499500
Note that 0r(n,1000)9990 \leq r(n, 1000) \leq 999 and 0r(n,1001)10000 \leq r(n, 1001) \leq 1000. Consider the (10002)=499500\binom{1000}{2}=499500 ways to choose pairs (i,j)(i, j) such that i>ji>j. By the Chinese Remainder Theorem, there is exactly one nn such that 1n100010011 \leq n \leq 1000 \cdot 1001 such that ni(mod1000)n \equiv i \pmod{1000} and nj(mod1001)n \equiv j \pmod{1001}. Finally, it is easy to check that none of the nn in the range 10000011000001 to 10010001001000 satisfy the condition, so the answer is exactly 499500499500.

Want a route through all this instead of an archive? The track puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement reproduced verbatim; metadata (topic, difficulty) added by this project.