Sum of digits of numbers from $1$ to $10^n$

Well, it's not too hard to figure out that the sum of digits of 0 or 1 to 9 is 45. That's very helpful, since that sequence will appear a bunch. Just add 1, and 46 is the sum of digits from 1 to 10 (or 0 to 10).

In a way, that and the base shifts are all you need I believe. Let's do 100. We're going to get 10 times 45 in the ones place, for all of the numbers. As for the tens place, it moves ten times slower - but they all still pair up ten times to make 45 (try doing 10 with 20 with 30, 11 with 21 with 31, etc). so the sum from 1 to 99 is 450 + 450 = 900, and then add 1 + 0 + 0 to get 901.

In general, it should be $ 45n 10^{n - 1} + 1 $, by the reasoning I have described.


There is a constant pattern of nos. I will demonstrate it for 2 digit nos.
00 01 02 03 04 05 06 07 08 09
10 11 12 13 14 15 16 17 18 19
20 21 22 23 24 25 26 27 28 29 and it goes so on.

You can make a pattern of numbers for any digit nos.
Just add $0s$ before a number to make it of n-digit. Now due to this symmetrical pattern, all nos. 0,1,2,3,4. . . will be in equal amount.