# Pell numbers $a_n$, prove that $\sqrt{2a_{2n-1}\pm\sqrt{2}}\in\Bbb Q[e^{i\pi/8}]$

$$a_0 = 0, \quad a_1 = 1; \quad \text{for } n > 1, \quad a_n = 2 \cdot a_{n-1} + a_{n-2}$$ is the sequence 1, 2, 5, 12, 29, …

$$2a_{2n-1}$$ is the sequence 2, 10, 58, 338, 1970, …

I try to prove $$\sqrt{2a_{2n-1}+(-1)^n\sqrt2}=2\left(a_n\sin(\frac\pi8)+a_{n-1}\cos(\frac\pi8)\right)$$ is true for all $$n\ge1$$.

I verified it by direct calculation (see answer below). But I expect there are better proofs.

## Example

$$\sqrt{2-\sqrt{2}}=2 \sin\left(\frac{\pi }{8}\right),\quad\sqrt{2+\sqrt{2}}=2 \cos \left(\frac{\pi }{8}\right)$$
$$\sqrt{10+\sqrt{2}}=2 \left(2 \sin \left(\frac{\pi }{8}\right)+\cos \left(\frac{\pi }{8}\right)\right)$$ WA
$$\sqrt{58-\sqrt2}=2 \left(5 \sin \left(\frac{\pi }{8}\right)+2 \cos \left(\frac{\pi }{8}\right)\right)$$ WA
$$\sqrt{338+\sqrt{2}}=2\left(12 \sin \left(\frac{\pi}{8}\right)+5 \cos \left(\frac{\pi}{8}\right)\right)$$ WA
$$\sqrt{1970-\sqrt{2}}=2\left(29 \sin \left(\frac{\pi}{8}\right)+12 \cos \left(\frac{\pi}{8}\right)\right)$$ WA
$$\cdots$$

Substituting $$2a_{2n-1}=\frac{1}{\sqrt{2}}\left((1+\sqrt{2})^{2 n-1}-(1-\sqrt{2})^{2 n-1}\right)$$ into left side: $$\sqrt{2a_{2n-1}+(-1)^n\sqrt{2}}=\sqrt{\frac{1}{\sqrt{2}}\left((1+\sqrt{2})^{2n-1}-(1-\sqrt{2})^{2n-1}\right)+(-1)^n\sqrt{2}}$$
Substituting $$a_n = \frac{1}{2\sqrt{2}}\left((1+\sqrt{2})^n-(1-\sqrt{2})^n\right)$$ into right side: $$2\left(a_n\sin\left(\frac{\pi}{8}\right)+a_{n-1}\cos\left(\frac{\pi}{8}\right)\right)= \frac{1}{2\sqrt{2}}\left((1+\sqrt{2})^n-(1-\sqrt{2})^n\right)\sqrt{2-\sqrt2} + \frac{1}{2\sqrt{2}}\left((1+\sqrt{2})^{n-1}-(1-\sqrt{2})^{n-1}\right)\sqrt{2+\sqrt2}$$ and squaring, proving they are equal:
\begin{align*} &2a_{2n-1}+(-1)^n \sqrt{2}-\left(a_n\sqrt{2-\sqrt{2}}+a_{n-1}\sqrt{2+\sqrt{2}}\right)^2 \\ &= 2\left(\frac{1}{2\sqrt{2}}\left((1+\sqrt{2})^{2n-1}-(1-\sqrt{2})^{2n-1}\right)\right) + (-1)^n \sqrt{2} \\ &\quad - \left(\frac{1}{2\sqrt{2}}\left((1+\sqrt{2})^n-(1-\sqrt{2})^n\right)\sqrt{2-\sqrt{2}} + \frac{1}{2\sqrt{2}}\left((1+\sqrt{2})^{n-1}-(1-\sqrt{2})^{n-1}\right)\sqrt{2+\sqrt{2}}\right)^2 \\ &= \frac{1}{\sqrt{2}}\left((1+\sqrt{2})^{2n-1}-(1-\sqrt{2})^{2n-1}\right) + (-1)^n \sqrt{2} \\ &\quad - \left(\frac{1}{2\sqrt{2}}\left((1+\sqrt{2})^n-(1-\sqrt{2})^n\right)\sqrt{2-\sqrt{2}} + \frac{1}{2\sqrt{2}}\left((1+\sqrt{2})^{n-1}-(1-\sqrt{2})^{n-1}\right)\sqrt{2+\sqrt{2}}\right)^2 \\ &= \frac{1}{\sqrt{2}}\left((1+\sqrt{2})^{2n-1}-(1-\sqrt{2})^{2n-1}\right) + (-1)^n \sqrt{2} \\ &\quad - \left(\frac{1}{2\sqrt{2}}\left((1+\sqrt{2})^n-(1-\sqrt{2})^n\right)\sqrt{2-\sqrt{2}}\right)^2 \\ &\quad - 2\left(\frac{1}{2\sqrt{2}}\left((1+\sqrt{2})^n-(1-\sqrt{2})^n\right)\sqrt{2-\sqrt{2}}\right)\left(\frac{1}{2\sqrt{2}}\left((1+\sqrt{2})^{n-1}-(1-\sqrt{2})^{n-1}\right)\sqrt{2+\sqrt{2}}\right) \\ &\quad - \left(\frac{1}{2\sqrt{2}}\left((1+\sqrt{2})^{n-1}-(1-\sqrt{2})^{n-1}\right)\sqrt{2+\sqrt{2}}\right)^2 \\ &= \frac{1}{\sqrt{2}}\left((1+\sqrt{2})^{2n-1}-(1-\sqrt{2})^{2n-1}\right) + (-1)^n \sqrt{2} \\ &\quad - \frac{1}{8}\left((1+\sqrt{2})^n-(1-\sqrt{2})^n\right)^2(2-\sqrt{2}) \\ &\quad - \frac{1}{2\sqrt{2}}\left((1+\sqrt{2})^n-(1-\sqrt{2})^n\right)\left((1+\sqrt{2})^{n-1}-(1-\sqrt{2})^{n-1}\right)\\ &\quad - \frac{1}{8}\left((1+\sqrt{2})^{n-1}-(1-\sqrt{2})^{n-1}\right)^2(2+\sqrt{2}) \\ &= \frac{1}{\sqrt{2}}\left((1+\sqrt{2})^{2n-1}-(1-\sqrt{2})^{2n-1}\right) + (-1)^n \sqrt{2} \\ &\quad - \frac{1}{8}\left((1+\sqrt{2})^{2n}-2(-1)^n+(1-\sqrt{2})^{2n}\right)(2-\sqrt{2}) \\ &\quad - \frac{1}{2\sqrt{2}}\left((1+\sqrt{2})^{2n-1}-2(-1)^{n-1}+(1-\sqrt{2})^{2n-1}\right)\\ &\quad - \frac{1}{8}\left((1+\sqrt{2})^{2(n-1)}-2(-1)^{n-1}+(1-\sqrt{2})^{2(n-1)}\right)(2+\sqrt{2}) \\ &= 0 \end{align*}