2. Calculate the sum of all four-digit numbers in which the digit 0 does not appear and all digits are different.
Solution. The number of all such numbers is $9 \cdot 8 \cdot 7 \cdot 6=3024$. To each number $\overline{a b c d}$, we associate the number $\overline{(10-a)(10-b)(10-c)(10-d)}$. The sum of these two numbers is 11110, so the sum of all numbers is

$$
\frac{3024}{2} \cdot 11110=16789320
$$