Recursion $y_n = ky_{n-1}+ry_{n-2}, y_0 = 2, y_1 = k$ and Fermat Theorem I was looking for the 
$$y_n = ky_{n-1}+ry_{n-2},\\ y_0 = 2,\\ y_1 = k$$ 
recursive relation and according Diophantine equations  $y_n=z^2$. Then I saw that for the $$k=A+B\\ r=-AB \\ y_n=A^n+B^n$$
So if we look for $y_n=Z^n$ this is equivalent to Fermat Theorem.
I did some investigation and there can be a way to go deeper. But I was unable to find any paper about this method. So my question is if there is any paper or may be any idea about the method investigating/solving the Diophantine equations based on general recursive relation, which is: 
$$y_n = ky_{n-1}+ry_{n-2}$$
EDITED
Here we were talking about the integer A and B numbers, but if A and B are rational, then the Fermat Last Theorem can be rephrased as $$y_n=1$$
can not take place for $n>2$.
 A: It depends, here is a paper on Diophantine equations and sections 2.1.2/2.1.3 show links between binary recurrences and Pell's equations. But, and this is important, those recurrences rely on the minimal solution in positive integers.
In this particular case, using characteristic polynomial method to solve linear recurrences
$$y^2=ky+r \Leftrightarrow y^2-ky-r=0$$
$$\color{red}{y_{1}=}\frac{k-\sqrt{k^2+4r}}{2} \text{ and } \color{red}{y_{2}=}\frac{k+\sqrt{k^2+4r}}{2}$$
So general solution is
$$y_n=C_1 y_1^n+C_2 y_2^n$$
where
$$2=C_1 + C_2$$
$$k=C_1 y_1+C_2 y_2=\\
C_1 \frac{k-\sqrt{k^2+4r}}{2}+C_2 \frac{k+\sqrt{k^2+4r}}{2}=\\
\frac{C_1 k-C_1 \sqrt{k^2+4r}+C_2 k+C_2\sqrt{k^2+4r}}{2}=\\
\frac{2k -C_1 \sqrt{k^2+4r} + C_2\sqrt{k^2+4r}}{2}$$
leading to $$C_1=C_2=1$$
and the final solution is
$$y_n=y_1^n+y_2^n$$
The trick with $k=A+B, r=-AB$ works as well, leading to $y_n=A^n+B^n$ as you pointed out, so far so good. But, will you find the minimal solution in positive integers, given Fermat's Last Theorem was proved?
