Learn / Library / Brainteasers
Total of all digits written
The integers from to are written out in ordinary decimal notation with no leading zeros, and every digit written is added to a running total. What is the final total?
Checking an answer needs JavaScript. The hint and the solution open without it.
Hint
Split the range into blocks where the digit sums are easy: single digits, -digit numbers, then the hundreds.
Solution
- The numbers to contribute , and the numbers to contribute , because each tens digit from to appears times and each units digit appears times.
- The numbers to contribute from the hundreds digit plus from the last digits, which is .
- The numbers to contribute from the hundreds digit, from the tens digits of to , from their units digits, and from the tens digit of , which is in all.
- Adding the blocks gives .
Answer: