342. Each natural number from 1 to 50000 is replaced by the number equal to the sum of its digits. The same operation is performed with the resulting numbers, and this is repeated until all numbers become single-digit. How many times will each of the integers from 0 to 8 appear among these single-digit numbers?
The specified single-digit numbers in sequential order are:

$$
1,2,3,4,5,6,7,8,0,1,2,3,4,5,6,7,8,0, \ldots
$$

This pattern continues. Indeed, when a natural number is replaced by the sum of its digits, the remainder when divided by 9 remains unchanged (prove this!). Therefore, when transitioning from each natural number to the next, the remainder when divided by 9 increases by 1 or jumps from 8 to 0.

To determine how many such groups of 9 digits each there are, we divide 50000 by 9 with a remainder: $50000 = 9 \cdot 5555 + 5$.

Thus, there are 5555 such groups. Another, incomplete group is formed by the last 5 digits $1,2,3,4,5$.

Answer: $1,2,3,4,5$ - 5556 times each, $6,7,8,0$ - 5555 times each.