## The curious powers of 1 + sqrt 2: a clever solution

Recall that we are trying to answer the question:

What’s the 99th digit to the right of the decimal point in the decimal expansion of $(1 + \sqrt 2)^{500}$?

In my previous post, we computed $(1 + \sqrt 2)^n$ for some small $n$ and conjectured that the answer is $9$, since these powers seem to be alternately just under and just over an integer. Today, I’ll explain a clever solution, which I learned from Colin Wright (several commenters also posted similar approaches).

First, let’s think about expanding $(1 + \sqrt 2)^n$ using the Binomial Theorem:

$\displaystyle (1 + \sqrt 2)^n = 1 + n \sqrt 2 + \binom{n}{2} (\sqrt 2)^2 + \binom{n}{3} (\sqrt 2)^3 + \dots + (\sqrt 2)^n.$

We get a sum of powers of $\sqrt 2$ with various coefficients. Notice that when $\sqrt 2$ is raised to an even power, we get an integer: $(\sqrt 2)^2 = 2$, $(\sqrt 2)^4 = 2^2 = 2$, and so on. The odd powers give us irrational things. So if we could find some way to “cancel out” the odd, irrational powers, we would be left with a sum of a bunch of integers.

Here is where we can pull a clever trick: consider $(1 - \sqrt 2)^n$. If we expand it by the Binomial Theorem, we find

$\displaystyle \begin{array}{rcl} (1 - \sqrt 2)^n &=& \displaystyle 1 + n (-\sqrt 2) + \binom{n}{2} (-\sqrt 2)^2 + \binom{n}{3} (-\sqrt 2)^3 + \dots + (-\sqrt 2)^n \\[1.5em] &=& \displaystyle 1 - n \sqrt 2 + \binom{n}{2} (\sqrt 2)^2 - \binom{n}{3} (\sqrt 2)^3 + \dots \pm (\sqrt 2)^n \end{array}$

but this is the same as the expansion of $(1 + \sqrt 2)^n$, with alternating signs: the odd terms—which are exactly the irrational ones—are negative, and the even terms are positive. So if we add these two expressions, the odd terms will cancel out, leaving us with two copies of all the even terms:

$\displaystyle (1 + \sqrt 2)^n + (1 - \sqrt 2)^n = 2 \left(1 + \binom{n}{2} (\sqrt 2)^2 + \binom{n}{4} (\sqrt 2)^4 + \dots \right).$

For now, we don’t care about the value of the sum on the right—the important thing to note is that it is an integer, since it is a sum of integers multiplied by even powers of $\sqrt 2$, which are just powers of two.

We are almost done. Notice that $\sqrt 2 \approx 1.4142 \dots$, so $1 - \sqrt 2 \approx -0.4142 \dots$. Since this has an absolute value less than $1$, its powers will get increasingly close to zero; since it is negative, its powers will alternate between being positive and negative. Hence,

$\displaystyle (1 + \sqrt 2)^n + (1 - \sqrt 2)^n$

is an integer, and $(1 - \sqrt 2)^n$ is very small, so $(1 + \sqrt 2)^n$ must be very close to that integer. When $n$ is even, $(1 - \sqrt 2)^n$ is positive, so $(1 + \sqrt 2)^n$ must be slightly less than an integer; conversely, when $n$ is odd we conclude that $(1 + \sqrt 2)^n$ is slightly greater than an integer.

To complete the solution to this particular problem, we have to make sure that $(1 - \sqrt 2)^{500}$ is small enough that we can say for sure the 99th digit after the decimal point of $(1 + \sqrt 2)^{500}$ is still 9. That is, we need to prove that, say, $(1 - \sqrt 2)^{500} < 10^{-100}$. This will be true if we can show that $|1 - \sqrt 2|^5 < 10^{-1}$ (just raise both sides to the $100$th power), and in turn, taking the base 10 logarithm of both sides, this will be true if $5 \log_{10} |1 - \sqrt 2| < -1$. At this point we can simply confirm by computation that $5 \log_{10} |1 - \sqrt 2| \approx -1.91\dots < -1$. The fact that we get $-1.91\dots$ means that not just 99, but actually the first 191 digits after the decimal point of $(1 + \sqrt 2)^{500}$ are 9. (It turns out that the 192nd digit is a $5$.)

The rabbit hole goes much deeper than this, however!