Maths Olympiad Prep

Library / HMMT February /290 of 1302

HMMT February

Number theory Difficulty 5.0 AIME, harder Find the answer

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

A number or a short expression. Fractions can be typed as 3/2, and spacing doesn't matter.

Solution

Note that 0≤r(n,1000)≤9990 \leq r(n, 1000) \leq 999 and 0≤r(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 1≤n≤1000⋅10011 \leq n \leq 1000 \cdot 1001 such that n≡i( mod 1000)n \equiv i(\bmod 1000) and n≡j( mod 1001)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,604 problems in a working order, from Junior Challenge level to the IMO shortlist.

Source: Omni-MATH, licensed Apache-2.0. Statement reproduced verbatim; metadata (topic, difficulty) added by this project.