Task B-1.6. Lovro writes down natural numbers one after another in a sequence:

$$
12345678910111213141516 \ldots
$$

and so on, without spaces or punctuation marks. He has written a total of 2013 digits. How many times did he write the digit 7? Justify your answer.
## Solution.

Among the 2013 digits written, there are 9 single-digit numbers, 90 two-digit numbers, and $x$ three-digit numbers.

It holds that $9 \cdot 1 + 90 \cdot 2 + x \cdot 3 = 2013$.

We get $x = 608$, meaning there are a total of 608 three-digit numbers.

The last written three-digit number is $99 + 608 = 707$.

From the number 1 to the number 99, the digit 7 appears 10 times in the last position, and 10 times in the first position (in the sequence from 70 to 79), which is a total of 20 times.

(2 points)

Similarly, the digit 7 will appear 20 times from the number 100 to the number 199, from 200 to 299, from 300 to 399, ..., from 600 to 699.

This means that by the number 699, the digit 7 has appeared $7 \cdot 20 = 140$ times.

From the number 700 to the number 707, the digit 7 appears 9 times.