Mirek was writing down the results of the small multiplication table of seven from 7 to 70 in a row. He wrote them down sequentially from the smallest to the largest without putting commas or spaces between them. In the resulting sequence of digits, he scratched out eleven of these digits. What is the largest and the smallest number he could have obtained?

(M. Petrová)
Mirek obtained this sequence of digits:

## 7142128354249566370.

By crossing out eleven digits, he must have been left with an eight-digit number. If such a number is to be as large (or as small) as possible, it must have the largest (or smallest) digit in the first position from the left, or possibly in the first few positions from the left.

a) The largest number. If the digit in the first position from the left is smaller than the digit in the second position from the left, we cross out the first digit. We then compare the first two digits from the left again, and if the first is smaller, we cross it out, and so on. If the digit in the first position from the left is larger than the digit in the second position from the left, we do not cross out any digit and compare the second and third digits from the left in the same way. After each digit is crossed out, we start the check of pairs of digits from the very left again. We repeat this process until we have crossed out a total of 11 digits.

7142128354249566370

7142128354249566370

742128354249566370

742128354249566370

742128354249566370

742128354249566370 we do not cross out anything

we cross out 1 (1st crossed out digit)

we do not cross out anything

we do not cross out anything

we do not cross out anything

we cross out 1 (2nd crossed out digit)

The subsequent steps are analogous; we only indicate the moments when we cross out some digits:

$$
\begin{aligned} \(742 \underline{28} 354249566370 &\) we cross out 2 (3rd crossed out digit) \\ \(74 \underline{28} 354249566370 &\) we cross out 2 (4th crossed out digit) \\ \(7 \underline{48} 354249566370 &\) we cross out 4 (5th crossed out digit) \\ \(\underline{78354249566370} &\) we cross out 7 (6th crossed out digit) \\ \(\underline{35} 4249566370 &\) we cross out 3 (7th crossed out digit) \\ 854249566370 & we cross out 2 (8th crossed out digit) \\ \(854 \underline{49566370} &\) we cross out 4 (9th crossed out digit) \\ \(85 \underline{49} 566370 &\) we cross out 4 (10th crossed out digit) \\ 859566370 & we cross out 5 (11th crossed out digit) \end{aligned}
$$

The largest number Mirek could have obtained is 89566370.
b) The smallest number. We proceed similarly to finding the largest number; we cross out the larger digits instead:

| $\underline{7142128354249566370}$ | we cross out 7 (1st crossed out digit) |
| :---: | :---: |
| $\underline{142128354249566370}$ | we do not cross out anything |
| $\underline{142128354249566370}$ | we cross out 4 (2nd crossed out digit) |

Further, only in abbreviated form:

$$
\begin{aligned} 12128354249566370 & we cross out 2 (3rd crossed out digit) \\ 1128354249566370 & we cross out 8 (4th crossed out digit) \\ 112354249566370 & we cross out 5 (5th crossed out digit) \\ \(1123 \underline{42} 49566370 &\) we cross out 4 (6th crossed out digit) \\ \(112 \underline{32} 49566370 &\) we cross out 3 (7th crossed out digit) \\ 112249566370 & we cross out 9 (8th crossed out digit) \\ 11224566370 & we cross out 6 (9th crossed out digit) \\ \(112245 \underline{63} 70 &\) we cross out 6 (10th crossed out digit) \\ 112245370 & we cross out 5 (11th crossed out digit) \end{aligned}
$$

The smallest number Mirek could have obtained is 11224370.

Alternative solution. Mirek obtained this sequence of digits:

7142128354249566370.

By crossing out eleven digits, he must have been left with an eight-digit number. If such a number is to be as large (or as small) as possible, it must have the largest (or smallest) digits in the first positions from the left. Instead of crossing out the excess digits, we will select the appropriate ones.

a) The largest number. The digit 9 appears only once in the sequence and is the largest selected number starting with the digit 9 is 9566370. However, this number is only seven digits long, so the desired number cannot start with the digit 9. The next smaller digit is 8, which appears only once in the sequence and is right before the 9. The largest selected eight-digit number is therefore 89566370.

b) The smallest number. We cannot start with the digit 0, and we do not intend to. (Additionally, since this digit is at the very end of the sequence, it can only be at the end of the selected number, so we can ignore it in the following discussions.) The digit 1 appears twice in the sequence; we can select both as the first two digits of the desired number because there are still enough digits to the right of the second 1 in the sequence to form an eight-digit number. The digit 2 appears twice after the second 1 - we can select these two 2s as the third and fourth digits of the desired number because there are still enough digits to the right of the last 2 in the sequence to form an eight-digit number. Currently, we have 1122**** and need to add the last four digits from the remaining sequence 49566370.

The digit 3 after the last used 2 is the only one, but we cannot use it because then we would not complete the eight-digit number. The digit 4 after the last used 2 is the only one - we select it and look for the last three digits. The smallest digit after this 4 is 3, which is the second-to-last digit; when we select it, the last two digits are already clear. The smallest selected eight-digit number is therefore 11224370.

Note. The previous considerations using crossing out can be summarized as follows.

a) The largest number:

7142128354249566370

8354249566370

b) The smallest number:

7142128354249566370

142128354249566370

1128354249566370

112249566370

Evaluation. Award 1 point for correctly writing the original sequence of digits (i.e., without any crossed out digits). Award another 3 points for finding the first of the numbers (the largest or the smallest), of which 2 points for describing the method of crossing out digits and 1 point for the correct result. Award the last 2 points for finding the second of the numbers, of which 1 point for the method and 1 point for the correct result.

Consider a solution to be correct and complete if the correct method of finding the digits to be crossed out is briefly explained for both numbers, even if no individual crossed out digit is justified separately. If the solution lacks any indication of the correct method, evaluate the problem with a maximum of 3 points. If the solver believes that it is sufficient to cross out all the smallest, or largest, digits from the entire sequence, award them no more than 1 point (for correctly writing the sequence of digits).