How many eight-digit numbers are there in which each occurring digit appears exactly as many times as the value of the digit? (Example: 33414 434.)
Solution. For writing an eight-digit number, we can use the numbers from 1 to 8.

A number consisting of 8 eights is only $\mathbf{1}$.

For a number containing 7 sevens, the eighth digit can only be 1, and this can be in any of the 8 positions, giving a total of 8 possibilities.

For a number containing 6 sixes, the remaining two positions can only be 2. The total number of possibilities is:

$$
\frac{8!}{6! \cdot 2!}=\frac{7 \cdot 8}{1 \cdot 2}=\mathbf{28}
$$

(repeated permutation).

For a number containing 5 fives, the remaining positions can have 1 one and 2 twos, or three threes. In the first case,

$$
\frac{8!}{5! \cdot 2!}=\frac{6 \cdot 7 \cdot 8}{1 \cdot 2}=\mathbf{168}
$$

while in the second case,

$$
\frac{8!}{5! \cdot 3!}=\mathbf{56}
$$

is the number of possibilities.

Finally, if we have 4 fours, the remaining 4 positions can be filled with 1 one and 3 threes, giving

$$
\frac{8!}{4! \cdot 3!}=\mathbf{280}
$$

new numbers.

This covers all possibilities, as using 3s, 2s, and 1s can only form a six-digit number that meets the condition.

The number of eight-digit numbers that meet the condition: $1+8+28+168+56+280=541$.