<s>[INST] If $a_{n+1}=\frac {a_n^2+5} {a_{n-1}}$ then $a_{n+1}=Sa_n+Ta_{n-1}$ for some $S,T\in \Bbb Z$. Question

Let $$a_{n+1}:=\frac {a_n^2+5} {a_{n-1}},\, a_0=2,a_1=3$$
Prove that there exists integers $S,T$ such that  $a_{n+1}=Sa_n+Ta_{n-1}$.

Attempt
I calculated the first few values of $a_n$: $a_2=7,a_3=18, a_4=47$ so I'd have the system of diophantine equations:
$$
7=3S+2T\\
18=7S+3T\\
47=18S+7T
$$
Now: it seems that all of the $a_i$ are pairwise coprime, so these equations should always have solutions, but how could I check that the intersection of all the solutions is not $\emptyset$?
 [/INST] From the recurrence relation we have
$$
a_{n+1} a_{n-1} - a_n^2 = 5
=
a_{n+2} a_{n} - a_{n+1}^2.
$$
So
$$
a_{n+1} \, (a_{n-1} + a_{n+1}) = a_n \, (a_n + a_{n+2}).
$$
or
$$
\frac{a_{n-1} + a_{n+1}}{a_n} = \frac{a_n + a_{n+2}}{a_{n+1}},
$$
This means
$$
c_n \equiv \frac{a_{n-1} + a_{n+1}}{a_n}.
$$
satisfies $c_n = c_{n+1}$, and thus is a constant.
Let $c_n = S$.
By $a_0 = 2$, $a_1 = 3$, $a_2 = (a_1^2 +5)/a_0 = 7$, we determine $S = 3$.
Thus,
$$
a_{n+1} = 3 \, a_n - a_{n-1} = S \, a_n + T \, a_{n-1},
$$
where $S = 3$, $T = -1$.
</s>