5. Lydia likes a five-digit number if none of the digits in its notation is divisible by 3. Find the total sum of the digits of all five-digit numbers that Lydia likes.
Solution. Lidia likes five-digit numbers composed only of the digits $1,2,4,5,7,8$. Note that all such numbers can be paired in the following way: each digit $a$ is replaced by $9-a$, that is, 1 is replaced by 8, 2 by 7, 4 by 5, and vice versa. For example, the number 42718 is paired with the number 57281. This partition is good because the sum of the digits in each pair is 45 (since the sum of the two digits in each place is 9).

It remains to determine how many such pairs there are. To do this, we find the total number of numbers. In the first place, any of the six digits can stand, in the second place - also any of the six, and so on. The total number of numbers is $6^{5}$. The number of pairs is $6^{5} / 2$, and the sum of the digits in each of them is 45. The total sum of the digits is $45 \cdot 6^{5} / 2 = 45 \cdot 7776 / 2 = 45 \cdot 3888 = 174960$.

Another solution. We find the total sum of the digits in the highest place of all numbers. There are $6^{4}$ numbers that start with one, and the sum of their first digits is $1 \cdot 6^{4}$. There are also $6^{4}$ numbers that start with two, and the sum of the first digits in them is $2 \cdot 6^{4}$. We proceed similarly with numbers starting with $3,4,7,8$. We get the total sum of the digits in the highest place $(1+2+4+5+7+8) \cdot 6^{4} = 27 \cdot 6^{4}$. In each of the other places, the sum of the digits is the same, so we have $5 \cdot 27 \cdot 6^{4} = 174960$.

Remark. The digit 0 is divisible by $3 (0: 3=0)$, so it cannot be included in the specified numbers.

Answer: 174960.