43.Digit Sum to a Million
★★★combinatoricsJane Street
What is the sum of the digits of all the integers from 1 to 1,000,000 inclusive? (This is the total of every digit written down, not the sum of the numbers themselves.)
Sign in to submit an answer and track it toward your stats.
Sign inHint
Pad every number below a million to six digits with leading zeros. Each position then takes each digit equally often, and pairing a number with its nines-complement gives an even faster route.
Want timed drills, mental math, and a market-making game too? Try the full practice suite →