5. There is one card with the digit 5, two cards with the digit 3, and a hundred cards with the digit 2.
a) In how many ways can a ten-digit number be formed from them, such that the product of the digits ends in 0?

b) All such numbers were written in ascending order. What number is in the 455th position?
Answer. a) 460 ways; b) 5322222322.

Solution. a) Among the selected cards, there will definitely be cards with a two, so the product of the digits is even. It ends in 0 if and only if the card with a five is also among the selected ones. The number of cards with a three can be 0, 1, or 2.