Olympiad Maths Prep

Track / Stage 6 / 50 of 400 #1050 of 2000

Problem 1050

National olympiad, first round
Number theory Difficulty 6.0 Prove it

4. On the screen of a supercomputer, the number 11111 \ldots 1 (900 ones) is printed. Every second, the supercomputer replaces it according to the following rule. The number is written in the form AB\overline{A B}, where BB consists of its last two digits, and it is replaced by 2A+8B2 \cdot A + 8 \cdot B (if BB starts with a zero, it is omitted in the calculation). For example, 305 is replaced by 23+85=462 \cdot 3 + 8 \cdot 5 = 46. If the number on the screen is less than 100, the process stops. Is it true that it will stop?

(202370(2023-70, M. Evdokimov ))

This one wants a proof. Work it on paper, read the official solution, then mark yourself honestly — the ladder only means something if the record is true.

Official solution

Answer. No, it will not stop.

Solution. The condition can be rephrased as follows: if the number on the screen is of the form 100A+B100 A + B, where 0B<1000 \leqslant B < 100, then it is replaced by 2A+8B2 A + 8 B. Since B<100B < 100, it follows that 8B<8008 B < 800, so all numbers starting from 800 will necessarily decrease. A natural question is - can anything prevent the number from decreasing further? Or can we determine to what number, less than 800, the supercomputer will "count down"? First, from the above expression, it is clear that the difference between the number and its image is always divisible by 7. Thus, the remainder upon division by 7 is preserved. Since 1001=711131001 = 7 \cdot 11 \cdot 13 is divisible by 7, so is 111111=1111001111111 = 111 \cdot 1001, and therefore, the number consisting of 900=6150900 = 6 \cdot 150 ones. This means that all resulting numbers will also be divisible by 7 - and by 14, because 2A+8B2 A + 8 B is always even.

However, this is not enough. Does the divisibility by any other prime number pp remain unchanged (or change in a predictable way)?

If 100A+B100 A + B is divisible by pp, then so is 8(100A+B)=800A+8B8(100 A + B) = 800 A + 8 B (and if it is not divisible, the remainder is multiplied by 8). The difference between this number and 2A+8B2 A + 8 B is (8002)A=798A(800 - 2) A = 798 A, so if pp is a divisor of 798, the remainder upon division by pp will be multiplied by 8. 798=7114=72319798 = 7 \cdot 114 = 7 \cdot 2 \cdot 3 \cdot 19; this gives us two new prime numbers, 3 and 19.

Let's see what remainder the initial number gives when divided by 3 and 19. It is divisible by 3 because 900 is divisible by 3. Finally, 1018110^{18} - 1 is divisible by 19, which follows from Fermat's Little Theorem, but can also be verified by "long division". Therefore, the number consisting of 900=1850900 = 18 \cdot 50 ones is divisible by 19. Hence, all iterations, starting from the second, will be divisible by 798. This means that the final (non-zero!) number will never be less than 100.

Comment. If we had not been "lucky" with the choice of the initial number - we could have "tracked" the changes in the remainders upon division by 3, 7, and 19 (since they are multiplied by 8 at each step), and determine whether there are any resulting numbers less than 100.

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