<s>[INST] How to write $[(2+\sqrt{3})^n + (2-\sqrt{3})^n + (2+\sqrt{3})^{n+1} + (2-\sqrt{3})^{n+1}]/6$ to the form $a^2 + 2 b^2$ ($a, b \in \mathbb{N}$). We know that $(2+\sqrt{3})^n + (2-\sqrt{3})^n$ is an integer (See here).
However, we want to write the formula
\begin{align}
&\frac{3+\sqrt{3}}{6} (2+\sqrt{3})^n + \frac{3-\sqrt{3}}{6} (2-\sqrt{3})^n\\
&=\frac{1}{6} \left[(2+\sqrt{3})^{n+1} + (2-\sqrt{3})^{n+1} + (2+\sqrt{3})^n + (2-\sqrt{3})^n\right]
\end{align}
to the form
$$a^2 + 2\,b^2,\ (a, b \in \mathbb{N}).$$
How?
 [/INST] Let $f(n)= 
\dfrac{3+\sqrt{3}}{6} (2+\sqrt{3})^n + \dfrac{3-\sqrt{3}}{6} (2-\sqrt{3})^n$ and $g(n)=\dfrac{\sqrt3} 6(2+\sqrt3)^n-\dfrac{\sqrt3}6(2-\sqrt3)^n$.
Can you show $f(n)^2+2\times g(n)^2=f(2n)$ and $f(n)^2+2\times g(n+1)^2=f(2n+1)?$
</s>