7. 7-8 grade Excellent student Kolya found the sum of the digits of all numbers from 0 to 2012 and added them all together. What number did he get? Answer: 28077.
Solution. Note that the numbers 0 and 999, 1 and 998, ..., 499 and 500 complement each other to 999, i.e., the sum of their digit sums is 27. Adding their digit sums, we get $27 \times 500 = 13500$. The sum of the digits of the numbers from 1000 to 1999, by similar reasoning, is 14500 (here we account for the fact that each number has an additional one, so the sum increases by a thousand). The numbers 2000, 2001, ... 2012 remain, and their digit sum is 77. In total, we get $13500 + 14500 + 77 = 28077$.