Kuba wrote down a four-digit number, two of whose digits were even and two were odd. If he crossed out both even digits in this number, he would get a number four times smaller than if he crossed out both odd digits in the same number.

What is the largest number with these properties that Kuba could have written down?

(M. Petrová)

Hint. What is the largest number Kuba could get after crossing out the even digits?
After crossing out the even digits, the remaining number should be four times smaller than another two-digit number. This number must therefore be smaller than $25(4 \cdot 25=100$, and that is already a three-digit number).

After crossing out the even digits, the remaining number should be composed of odd digits. The largest such number that is also smaller than 25 is the number 19. However, $4 \cdot 19=76$, which is not a number composed of even digits.

The next candidate is the number 17. For this, $4 \cdot 17=68$, which is a number composed of even digits.

The four-digit number, therefore, was composed of the odd digits 1 and 7 (in this order) and the even digits 6 and 8 (in this order), with no restrictions on the order of odd and even digits. The largest number meeting all these requirements is 6817. This is the largest number Kuba could have written.

There is no need to check further options: the quadruple of a number smaller than 17 is less than 68, so it is not possible to get a larger number than 6817 while meeting the other conditions.

#