Using 5 non-zero digits, we can form 120 numbers, without repeating a digit within the same number. Let $S$ be the sum of all these numbers. Determine the sum of the digits of $S$, where:

a) 1, 3, 5, 7, and 9 are the 5 digits;

b) 0, 2, 4, 6, and 8 are the 5 digits, remembering that 02468 is a number with 4 digits and, therefore, we will not have 120 numbers in this case.
Solution

a) There are 120 numbers in total, with all possible combinations. Thus, in each of the positions (units, tens, hundreds, thousands, ten thousands), each digit appears the same number of times, that is, $\frac{120}{5}=24$. For example, in the units place, the digit 1 appears 24 times, as does 3, 5, 7, and 9. Therefore, the sum of all the units is:

$$
\begin{aligned}
24 \cdot 1+24 \cdot 3+24 \cdot 5+24 \cdot 7+24 \cdot 9 & = \\
24(1+3+5+7+9) & = \\
24 \cdot 25 & =600
\end{aligned}
$$

Thus, the sum $S$ is:

$$
\begin{aligned}
S & =600+600 \cdot 10+600 \cdot 100+600 \cdot 1.000+600 \cdot 10.000 \\
& =600(1+10+100+1.000+10.000) \\
& =600 \cdot 11.111 \\
& =6.666 .600
\end{aligned}
$$

Finally, the sum of the digits of $S$ is $6+6+6+6+6+0+0=30$.

b) We will use the same reasoning as in the previous item, also counting the numbers that start with 0, that is, those that have only 4 digits. Calling this sum of the 120 numbers $S^{\prime}$, we have:

$$
\begin{aligned}
S^{\prime} & =24 \cdot(0+2+4+6+8) \cdot 11.111 \\
& =24 \cdot 20 \cdot 11.111 \\
& =5.333 .280
\end{aligned}
$$

We now need to subtract the numbers that start with 0, which is the sum of all 4-digit numbers that can be formed with 2, 4, 6, and 8 (120-24 = 96 in total). This sum is $24 \cdot(2+4+6+8) \cdot 1.111=533.280$. Therefore, $S=S^{\prime}-533.280=4.800 .00$, and the sum of its digits is $4+8+0+0+0+0+0=12$.