What is the sum of the digits needed to write all the whole numbers from $0$ to $1,000$ inclusive? What is the sum of the digits needed to write all the whole
numbers from $0$ to $1,000$ inclusive?
I found a solution but I don't understand why there are $300$ zeros, $300$ ones, ..., $300$ nines.
The answer is $13501.$
 A: Ignore $1000$ for now, and imagine writing the numbers from $0$ through $999$ in order in a column. Write them all as three-digit numbers by adding leading zeroes if necessary, so that the first two numbers in your list will be $000$ and $001$; the extra zeroes won’t make any difference to the sum of the digits. 
As you read down the rightmost column, the digits just run from $0$ through $9$ repeatedly; since there are $1000$ numbers in the list and just $10$ digits, this cycle must occur $100$ times, so each digit occurs $100$ times in the rightmost column.
As you read down the middle column, you first encounter a block of $10$ zeroes, then a block of $10$ ones, and so on up through a block of $10$ nines for the numbers $090,091,\ldots,099$, and then this cycle repeats. It’s a cycle in which each of the $10$ digits appears $10$ times for a total of $100$ entries, and there must be $10$ repetitions of this cycle, so each of the $10$ digits also occurs $100$ times in the middle column.
And the leftmost column is the easiest of all. The first $100$ numbers are less than $100$, so the first $100$ entries in the column are zeroes. The next $100$ entries are ones, for the numbers from $100$ through $199$, and so on, each of the $10$ digits appearing $100$ times. Thus, each digit appears $100$ times in each column, or $300$ times altogether. The sum of those $3000$ digits is
$$300\sum_{k=0}^9k=300\cdot\frac{9\cdot10}2=13,500\;,$$
and the number $1000$ adds $1$ to that for a grand total of $13,501$.
A: Represent numbers by padding with zeroes (this doesn't change the sum of digits). Then the digits $0,1, \ldots, 9$ are symmetric in the numbers $000-999$.  So the average of all digits in all numbers will be the same as the average of $0, 1, \ldots, 9$ which is $4.5$.  There are $3 \cdot 1000$ digits in all, so the total sum will be $4.5 \cdot 3000 = 13500$.  Then add one (representing the number $1000$).  
(Equivalently, there are $3000$ total digits in $000-999$, divided equally among $0, 1, \ldots, 9$, which gives $300$ of each digit.)
