# Problem 2.

In-1 A 2022-digit natural number is guessed, any two adjacent digits of which (arranged in the same order) form a two-digit number that is divisible either by 19 or by 23. The guessed number starts with the digit 4. What digit does it end with?
Answer: 6 or 8.

Solution. Two-digit numbers divisible by 19 are 19, 38, 57, 76, 95. Two-digit numbers divisible by 23 are $23, 46, 69, 92$. Since the first digit is 4, the second digit is 6, the third is 9, and the fourth is 2 or 5. If the fourth digit is 2, the continuation is: $2-3-8$ - there is no further continuation. Therefore, the fourth digit is 5, and the continuation is: $5-7-6-9-5-7-6$ and so on. Then we get an almost periodic sequence: $4-6-9-5-7-6-9-5-7-\ldots$, with a period of 4. Then the digit at the 2022nd position will be 6, since $2022=1+4 \cdot 505+1$. It was shown above that the digit 2 cannot appear in the initial positions of the guessed number. However, it can be the first, second, or third from the end. Therefore, it is possible that in the previous sequence, after the last digit 9, there are $2-3-8$. Then the last digit of the number is 8.

V-2 A 2021-digit natural number is guessed, any two adjacent digits of which (located in the same order) form a two-digit number that is divisible by either 19 or 23. The guessed number starts with the digit 1. What digit does it end with?

Answer: 6 or 8.

V-3 A 2021-digit natural number is guessed, any two adjacent digits of which (located in the same order) form a two-digit number that is divisible by either 19 or 23. The guessed number starts with the digit 4. What digit does it end with?

Answer: 3 or 7.

V-4 A 2022-digit natural number is guessed, any two adjacent digits of which (located in the same order) form a two-digit number that is divisible by either 19 or 23. The guessed number starts with the digit 9. What digit does it end with?

Answer: 2 or 5.

## Lomonosov Olympiad for Schoolchildren in Mathematics

#