The sum of digits of numbers from 98 to 101 is: . What is the sum of all the digits of the integers from 1 to 2008?
Note that the sum of digits of a number in base is given by:
Notation: denotes the floor function .
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Let the sums of unit digits, tenth digits, hundredth digits and thousand digits be s 0 , s 1 , s 2 and s 3 respectively. Then we have:
s 0 = ⌊ 1 0 2 0 0 8 ⌋ times 1 + 2 + ⋯ + 9 + 0 + 1 + 2 + ⋯ + 9 + 0 + ⋯ + 1 + 2 + ⋯ + 9 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 = 2 0 0 × 4 5 + 3 6 = 9 0 3 6
Similarly,
s 1 s 2 s 3 = ⌊ 1 0 0 2 0 0 8 ⌋ × 4 5 × 1 0 = 9 0 0 0 = ⌊ 1 0 0 0 2 0 0 8 ⌋ × 4 5 × 1 0 0 = 9 0 0 0 = 1000 to 1999 1 × 1 0 0 0 + 2000 to 2008 2 × 9 = 1 0 1 8
Therefore, the sum of digits from 1 to 2008 is s 0 + s 1 + s 2 + s 3 = 9 0 3 6 + 9 0 0 0 + 9 0 0 0 + 1 0 1 8 = 2 8 0 5 4 .