Maths Olympiad Prep

Track / Stage 5 / 63 of 400 #663 of 1964

Problem 663

AIME late
Number theory Difficulty 5.2 Find the answer

Example 3. Write the numbers 1,2,3,1, 2, 3, \cdots, 1986, 1987 on the blackboard. At each step, determine some numbers from those written and erase them, replacing them with the remainder of their sum divided by 7. After several steps, two numbers remain on the blackboard, one of which is 987. What is the second remaining number?
(13th All-Russian Mathematics Competition, 1987)

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

Official solution

Solution: Clearly, at each step, the sum of all the numbers written down modulo 7 is preserved.

Let the remaining number be xx, then x+987x+987 is congruent to 1+2++19871+2+\cdots+1987 modulo 7.

Since 1+2++1987=1987×7×1421+2+\cdots+1987=1987 \times 7 \times 142 is divisible by 7, the remainder is 0, so x+987x+987 is also divisible by 7. Since 987 is not the remainder when divided by 7, xx is the remainder of the operation when divided by 7, 0x60 \leqslant x \leqslant 6. Since 987 is divisible by 7,
thus x=0x=0.

Source: NuminaMath-1.5, licensed Apache-2.0. Statement and solution reproduced as published; topic, difficulty and ordering added by this site.