[Math] First 10 digits of large sum

arithmetic

There is a debate about this Project Euler problem in the discussion thread for the problem.

The debate is whether you only have to add the first 12 digits of each number in order to get the answer.

For the particular question, it works fine if you only sum the first 12 digits of each number. But is this always the case?

Best Answer

It does not necessarily work. Consider the following fifteen $12$-digit numbers:

\begin{align} 100000000019&\,\\ 100000000019&\,\\ 100000000019&\,\\ 100000000019&\,\\ 100000000019&\,\\ 100000000019&\,\\ 100000000019&\,\\ 100000000019&\,\\ 100000000019&\,\\ 100000000019&\,\\ 100000000019&\,\\ 100000000019&\,\\ 100000000019&\,\\ 100000000019&\,\\ \underline{+ \,\,\,100000000019}&\,\\ 1500000000\color{red}{2}85&\,\\ \end{align}

But

\begin{align} 10000000001&\,\\ 10000000001&\,\\ 10000000001&\,\\ 10000000001&\,\\ 10000000001&\,\\ 10000000001&\,\\ 10000000001&\,\\ 10000000001&\,\\ 10000000001&\,\\ 10000000001&\,\\ 10000000001&\,\\ 10000000001&\,\\ 10000000001&\,\\ 10000000001&\,\\ \underline{+ \,\,\,10000000001}&\,\\ 1500000000\color{red}{1}5&\,\\ \end{align}

Also, are you sure the result is the same if you ignore the $12^\text{th}$ digits? There are $100$ numbers in the $12^\text{th}$ places, and there is a high chance that their sum affects the $10^\text{th}$ place (it suffices that their average is at least $1$, but as Ross Millikan points out, it is also possible for the $12^\text{th}$ place digits to carry over without a total of $100$).