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$.