Let $( \sqrt{2} + 1)^{1000} = a + b \sqrt{2}$, where a and b are integers. Find the greatest common factor of b and 81. Let $( \sqrt{2} + 1)^{1000} = a + b \sqrt{2}$, where $a$ and $b$ are integers. Find the greatest common factor of $b$ and $81$.
How would one solve this question? I tried to use the binomial theorem but that approach did not work. How would one solve this problem if it were to appear on a Math Olympiad?  
I know the answer is one of:
(A) 1 (B) 3 (C) 9 (D) 27 (E) 81.
According to one of the Stack Exchange members, the answer is 3. It was found using Python.  

This is so long for a comment:
We say $ ( \sqrt{2} + 1)^{n} = a_n + b_n \sqrt{2}$ and $a_n,b_n$ are integers. Therefore $( 1- \sqrt{2})^{n} = a_n - b_n \sqrt{2}$. For positive odd value of $n=2k-1$, by product
$-1=( \sqrt{2} + 1)^{n} ( 1- \sqrt{2} )^{n}= (a_n + b_n \sqrt{2})(a_n - b_n \sqrt{2})$.
Hence $a_n^2 - 2b_n^2= -1$. $a^2-2b^2=-1$ is negative Pell equation and minimal solution is $(a_1,b_1)=(1,1)$. Other solutions: $a_{n+2}+b_{n+2}\sqrt 2= (a_n + b_n \sqrt 2)\cdot (1+\sqrt 2)^2$ and then
$$a_{n+2}= 3a_n + 4b_n$$ $$ b_{n+2} = 2a_n + 3b_b$$
For example $(a_3,b_3)=(7,5)$. So, $$a_{n+2} \equiv b_n \pmod{3}$$ $$b_{n+2} \equiv 2a_n \equiv 2b_{n-2}\pmod{3}$$
Since $b_1=1$ is not divisible by $3$, then for all odd $n$, $b_n$ is not divisible by $3$. Similarly, $a_n$ is not divisible by $3$.
In $ ( \sqrt{2} + 1)^{999} = a_{999} + b_{999} \sqrt{2}$, $a_{999}$ and $b_{999}$ can't divisible by $3$. Yet, I didn't say anything about $b_{1000}$. I will think about even values of $n$.
