5. A sequence of digits consists of the first 222 natural numbers written in a row. In this sequence, we cross out the digits that are in odd positions. After that, we again cross out the digits that are in (new) odd positions. We repeat this procedure until only one digit remains. Which digit will it be?

## Ministry of Science and Education of the Republic of Croatia

Agency for Education and Education

Croatian Mathematical Society

## COUNTY COMPETITION IN MATHEMATICS  March 24, 2022.
5. The sequence of digits consists of the first 222 natural numbers written in order. In this sequence, we cross out the digits that are in odd positions. After that, we again cross out the digits that are in (new) odd positions. We repeat this process until only one digit remains. Which digit will it be?

## Solution.

The sequence contains $9 \cdot 1 + 90 \cdot 2 + 123 \cdot 3 = 558$ digits. 1 POINT

After the first crossing out, the digits that remain are in the second, fourth, sixth, ... positions, i.e., in even positions. After the second crossing out, the digits that remain are those that were originally in the fourth, eighth, twelfth, ... positions. The remaining digits are those whose original position number is divisible by $4 = 2^2$.

After the third crossing out, the digits that remain are those whose original position number is divisible by $8 = 2^3$.

After the fourth crossing out, the digits that remain are those whose original position number is divisible by $16 = 2^4$.

It can be concluded that after each $k$-th crossing out, the remaining digits are those whose original position number is divisible by $2^k$.

3 POINTS

To determine the position of the digit that will remain last, it is necessary to determine the largest natural number $k$ for which $2^k < 558$ holds.

This occurs for $k = 9$, where $2^k = 512$.

In the end, the digit that remains will be the one in the 512th position in the sequence.

3 POINTS

The first 9 digits are the digits from 1 to 9.

Then come 180 digits that form all two-digit numbers.

Up to the 512th digit, there are $512 - 189 = 323$ digits left that form three-digit numbers, starting from the number 100.

Since $323 = 107 \cdot 3 + 2$, the desired digit is the second digit in the 108th three-digit number. This is the number 207, and the desired digit is the digit 0.

3 POINTS

TOTAL 10 POINTS

## COUNTY COMPETITION IN MATHEMATICS