6. (3 points) Anya counted all nine-digit numbers, all digits in each of which are different, divisible by 9. Kolya counted all ten-digit numbers, all digits in each of which are different, divisible by 5. Who of them counted more numbers?
Answer: both counted the same.

## Solution:

Let's establish a one-to-one correspondence between these sets of numbers. Consider some of Anya's numbers. Since it is divisible by 9, the sum of its digits is also divisible by 9. To satisfy this condition, the number must contain all digits except 0 or 9.

Append the missing digit to the end of Anya's number, and then swap the positions of 5 and 9. Now we have a ten-digit number ending in 0 or 5, which is exactly one of the numbers that Kolya counted.

The reverse transformation also works: swap the positions of 9 and 5, and then remove the last digit.

Of course, we could have directly counted the number of both sets. It amounts to $17 \cdot 8!$ !