## Task A-2.2. (4 points)

Ante wrote down all natural numbers from 1 to 40 in sequence without spaces, forming a multi-digit number $12345 \ldots 383940$. Then he decided to erase 60 digits of this number. What is the largest number Ante can obtain in this way?
## Solution.

The written number has $9+31 \cdot 2=71$ digits. After deleting 60 digits, Ante will obtain an 11-digit number.

The obtained number will be the largest possible if its initial digits are as large as possible, so instead of deleting digits, we will decide which digits to keep to get the largest 11-digit number (without changing the order of the digits).

This number can start with the maximum of three digits 9.

Indeed, among the written digits, there are four digits 9 (in the numbers 9, 19, 29, 39), but after the fourth digit 9, only two more digits remain (4 and 0), so we would not get an 11-digit number.

Therefore, the first three digits are 9, and these are from the numbers 9, 19, and 29. The remaining 8 digits will be chosen from the digits

$$
3031323334353637383940 \text {. }
$$

The fourth digit cannot be 8 or 7 because the resulting number would not be able to have 13 digits. Therefore, we will take the digit 6 (from the number 36) as the fourth digit.

The remaining seven digits will be chosen from the digits: $\quad 37383940$ so it is clear that we will only discard the first digit 3.

The largest number that can be obtained in this way is the number 99967383940.