TITLE: Sum of Square Roots Problem
QUESTION [5 upvotes]: Consider these two lists
A = {1,25,31,84,87,134,158,182,198}
B = {2,18,42,66,113,116,169,175,199}
Now for both lists, add 1,000,000 to each of the numbers then take the sum of their square roots. For example, list A gives us
$\sqrt{1000001}+\sqrt{1000025}+...\sqrt{1000198} = 9000.44998...$
Now what is interesting to note here is that the number obtained from list A and the number obtained from list B differ first in the 37th decimal place. A gives us the digit 2 and B gives us 5. Any explanation as to how/why does this happen? Or rather how were these numbers chosen? Is there some theory behind this, an algorithm perhaps to compile such lists or is it just some random number theory abomination?

REPLY [4 votes]: This is really a comment on Marvis' answer, but too large for one.  It shows a bit more detail about how it works.
Let's take a simpler set:  $A=\{1,6,8\}, B=\{2,4,9\}$.  We can see that $1+6+8=15=2+4+9, 1^2+6^2+8^2=101=2^2+4^4+9^2$.  Then if we form $\sqrt{1000001}+\sqrt{1000006}+\sqrt{1000008}-\sqrt{1000002}-\sqrt{1000004}-\sqrt{1000009}$ we get about $4.5 \cdot 10^{-15}$.  The point is that we have canceled out the leading terms in the Taylor series.  As Marvis says, $$\sqrt {1000006}= 1000\sqrt{1+\frac 6{1000000}}\approx 1000\left(1+\frac 12\frac 6{1000000}-\frac 12 \cdot \frac 12 \left(\frac 6{1000000}\right)^2+\frac 12 \cdot \frac 12 \cdot \frac 32 \left(\frac 6{1000000}\right)^3\right)$$ where we have kept the first four terms.  Because the sum of each set and the sum of squares of each set are the same, the terms linear and quadratic in $\frac 1{1000000}$ will cancel and we will be left with the term in $1000\left(\frac 1{1000000}\right)^3$, which is $10^{-15}$