Maths Olympiad Prep

Library / /251 of 860

Number theory Difficulty 5.0 AIME, harder Find the answer

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).

A number or a short expression. Spacing and $ signs are ignored.

Solution

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(\bmod 1000) and nj(mod1001)n \equiv j(\bmod 1001). Finally, it is easy to check that none of the nn in the range 1000001 to 1001000 satisfy the condition, so the answer is exactly 499500.

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: Omni-MATH, licensed Apache-2.0. Statement and solution reproduced as published; topic and difficulty added by this site.