**Part 1.** First determine the sum of all the digits needed to write each counting number from through . For example, the sum of all the digits needed to write each counting number from through would be .

**Part 2.** Next, find the sum of the digits of the sum found in Part 1. In other words, for through , the sum of all of the digits was , and the sum of the digits of that sum is .

**Part 3.** Finally, only submit your sum of the digits for the sum of the digits or simply the answer you determined for Part 2.

Source: mathcontest.olemiss.edu 11/4/2013

**SOLUTION**

We first try a few smaller problems to get a feel for what’s happening. Let’s find the sum of the numbers from . The following table lists the numbers from by columns. The sum of the numbers of each row is listed at the end of the row. For example, the sum of the numbers in the first row equals ; the sum of the numbers in the second row equals ; etc. Likewise, the sum of the numbers in each column is listed at the bottom of the column. For example, the sum of the numbers in the first column equals ; the sum of the numbers in the second column equals ; etc.

Sum of numbers

Rows:

Columns:

Sum of numbers

Rows:

Columns:

Sum of numbers

Rows:

Columns:

If we continue this method, we have the following results

Sum of numbers

As the numbers increase by from row to row, the sums increase by . The rows correspond to the intervals of into which the distance of from is divided. The sum stops at which is less than .

** **We are now ready to calculate the sum of numbers from

Number of -intervals

Finally, we add to the above sum

Sum of the digits

**Answer**:

**Alternative solution**Imagine a sheet of paper with the digits written in a table of rows by columns. If you fold the paper in half by folding the bottom half to the top half, you end up with a table of rows by columns a portion of which is shown below

If you add the digits horizontally across the rows, each row sums to for a total of .

The sum of the digits of equals .

Imagine a sheet of paper with digits through written in a table of rows by columns. Fold the paper in half and you end up with a smaller table of rows by columns.

If you add the digits horizontally across the rows, each row sums to for a total of .

The sum of the digits from equals

Finally where comes from .

Allow me to shine a blinding light of clarity upon this for you and your readers.

Visualize a table of 1e12 rows and 12 columns, append leading zeros to all numbers less than 1e12. Fill the rows of the table (right justified) with the numbers from 0 to ((1e12)-1). One digit per cell. Thinking about the variation in the columns reveals that each column has the exact same number of each digit, but in a different sort order or variation pattern. By inspecting the 10^0 (see note 1) column’s first 10 entries, we may determine that the average of all the cells (digits) in the table is 4.5 and there are 12e12 of them for a total sum of 54e12. To account for the contribution of 1e12 add 1 to the total sum. 5+4+(0*12)+1 = 10.

Note 1: The right most column of the table. 10^0 is also known as the units position or the Least Significant Digit before the decimal point.

As a further exercise: Apply your preferred method to a 32 bit binary number range. One may also do it in hexadecimal: 0000 0000 to FFFF FFFF. It is quite easy and fun; if you choose your method wisely. 3Ch8 = 3Cx16^8 = 257,698,037,760 in base 10.

You may be asking: “Where did the 3C come from?” Okay, well, it comes from ((F+0)/2) * 8 . Or in simple English, the average value of each digit times the number of columns. 7.5 * 8 = 60 = 3C in base 16.

Happy Trails.