<s>[INST] Consider the equation $a_n +b_n\sqrt{2} = (1+\sqrt{2})^n$ where $a_n, b_n \in \mathbb{Z} \ge 1$. Prove that $\gcd(a_n, b_n) = 1$. Consider the equation $a_n +b_n\sqrt{2} = (1+\sqrt{2})^n$ where $a_n, b_n \in \mathbb{Z} \ge 1$.  Prove that $\gcd(a_n, b_n) = 1$.
I know that $(1+2\sqrt{3}) = 1^3 + 3(1)^2(\sqrt{2})^2 + 3(1)(\sqrt{2})^2 + (\sqrt{2})^3 = 7+5\sqrt{2}$
so $a_n = 7, b_n = 5$ by binomial expansion.
So my strategy is to prove this via mathematical induction.  The base case is easy.  What I need for the inductive step is to get the relation between $(a_n+1, bn+1)$ to $(a_n, b_n)$.  So we get:
$$a_{n+1}, b_{n+1}\sqrt{2} = (1+\sqrt{2})(1+\sqrt{2})^n = (1+\sqrt{2})(a_n +b_n\sqrt{2}) = (a_n + 2b_n)+(a_n+b_n)\sqrt{2}$$
So we have $a_{n+1} = a_n + 2b_n, b_{n+1} = a_n + b_n$
So now I'm trying to use the euclidean algorithm to show that $\gcd(a_{n+1}, b_{n+1}) = 1$.  So we get:
$\gcd(a_{n+1}, b_{n+1}) = (a_n + 2b_n,a_n + b_n)=$
$a_n+2b_n= 1 *(a_n + b_n) + b_n =$
$a_n + b_n = 1 * (b_n) + a_n$
$b_n = 0 * (a_n) + bn$ 
But, where do I go from here?
Any help would be appreciated!
-IdleMathGuy
 [/INST] We have
$$
\pmatrix{a_{n+1} \\ b_{n+1}}
=
\pmatrix{1 & 2 \\ 1 & 1}
\pmatrix{a_n \\ b_n}
$$
and so
$$
\pmatrix{a_n \\ b_n}
=
\pmatrix{1 & 2 \\ 1 & 1}^n
\pmatrix{a_0 \\ b_0}
=
\pmatrix{1 & 2 \\ 1 & 1}^n
\pmatrix{1 \\ 0}
$$
Therefore, $\pmatrix{a_n \\ b_n}$ is the first column of $\pmatrix{1 & 2 \\ 1 & 1}^n$. Write
$$
\pmatrix{1 & 2 \\ 1 & 1}^n
=
\pmatrix{a_n & c_n \\ b_n & d_n}
$$
Taking determinants, we get
$$
(-1)^n = a_n d_n - b_n c_n
$$
which implies $\gcd(a_n, b_n) = 1$.
(It turns out and easily proved by induction that $d_n=a_n$ and $c_n=2b_n$, which is nice but not relevant here.)
</s>