<s>[INST] How to prove each element of the following sequence is a perfect square? Sequence $\{a_n\}$ satisfies the following formula:
$a_{n+2}=14a_{n+1}-a_n+12$,
and $a_1=1, a_2=1$.
It is easy to check that $a_3=25$ and $a_4=361$.
The question is how to prove each element of the sequence $\{a_n\}$ is a perfect square?
 [/INST] The above proofs are elegant. The following is what I was thinking:
Like what Steven did, we can use generation functions and write out $$a_n = c(2+\sqrt{3})^{2n} + d(2-\sqrt{3})^{2n} - 1$$ for some constants $c$ and $d$. Note that $c>0$ since $a_n$ increases as $n$ increases. If $d>0$, then $a_n = (\sqrt{c}((2+\sqrt{3})^n - \sqrt{d}(2-\sqrt{3})^n)^2 + (2\sqrt{cd} - 1 )$, and we want to show $ 2\sqrt{cd} - 1=0$, or $cd=1/4$.  
Write $\sigma = (2+\sqrt{3})$,  from $a_1=a_2$ we have $c\sigma^2 + d\sigma^{-2} = c\sigma^4 + d\sigma^{-4}$, which simplifies to $d=c\sigma^6$; then $d>c>0$.  We also have $2=a_1+1= c\sigma^2 + d\sigma^{-2} = c\sigma^2(1+\sigma^2) = c\sigma^2*4\sigma$, so $c\sigma^3= 1/2$, which yields $2\sqrt{cd} - 1= 2c\sigma^3-1= 0$. We then have $a_n=b_n^2$, where $b_n=\sqrt{c}(2+\sqrt{3})^n - \sqrt{d}(2-\sqrt{3})^n$. The sequence $\{b_n\}$ are integers since $b_1=b_2=1$ and $b_{n+2} = 4b_{n+1}-b_n$.  
</s>