Sequence : $a_k a_{k+2} +1 = a^2_{k+1}$ Determine all integers $b$ for which there exists a sequence $a_0, a_1, a_2,\ldots $ of rational numbers 
satisfying $a_0=0, a_2=b$ and $a_k a_{k+2} +1 = a^2_{k+1}$ for $k=0, 1, 2, \ldots$ 
that contains at least one nonintegral term.

My attempt :
$a_0=0, a_2=b$, so $a_0a_2+1=a^2_1$ then $a_1=\pm1$
$a_1a_3+1=a^2_2$ so  $a_3=\pm(b^2-1)$
We have $a_0, a_1, a_2, a_3 = 0, \;1, \;b, \;b^2-1$ or $\;0, \;-1, \;b, \;-b^2+1$ respectively. 
Since $a_k a_{k+2} +1 = a^2_{k+1}$ and $a_{k-1} a_{k+1} +1 = a^2_k$
so $a^2_k - a_{k-1} a_{k+1} = a^2_{k+1} - a_k a_{k+2}$
then $a^2_k + a_k a_{k+2} = a^2_{k+1} + a_{k-1} a_{k+1}$
$a_k(a_k + a_{k+2}) = a_{k+1}(a_{k+1} + a_{k-1})$
we have $\frac{a_k \;+ \;a_{k+2}}{a_{k+1}} = \frac{a_{k+1} \;\; + \;a_{k-1}}{a_k}$, for $a_k, a_{k+1} \not=0$, $\forall k\in \mathbb{N}$
that is $\frac{a_k \;+ \;a_{k+2}}{a_{k+1}} = \frac{a_0 \;+\; a_2}{a_1} = b$ or $-b$
Thus, $a_{k+2} = b\cdot a_{k+1}-a_k $ or  $a_{k+2} = -b\cdot a_{k+1}-a_k $ 
For $a_{k+2} = b\cdot a_{k+1}-a_k $ , we have $x^2-bx=1 = 0$
and $a_n = \frac{1}{\sqrt{b^2-4}}\left[\left(\frac{b+\sqrt{b^2-4}}{2}\right)^n - \left(\frac{b-\sqrt{b^2-4}}{2}\right)^n\right]$, so $b \not= \pm 2$
Since $a_l a_{l+2} +1 = a^2_{l+1}$ , if there exists $l$ such that $a_l = 0$, then $a^2_{l+1} = 1$ and $a_{l+1} = \pm1$
that is, we can always take $a_{l+2} \not\in \mathbb{Z}$ which make the sequence contain nonintegral term.
Hence, to be the integer sequence, only $a_0$ can be equal to $0$.  
If $a_2=b=0$ or $a_3=b^2-1=0$, i.e. $b=\pm 1$, the sequence can contain nonintegral term.
For $b \leq -3$ and $b \geq 3$,  
since $a_n = \frac{1}{\sqrt{b^2-4}}\left[\left(\frac{b+\sqrt{b^2-4}}{2}\right)^n - \left(\frac{b-\sqrt{b^2-4}}{2}\right)^n\right]$ 
if $b$ is even, all terms in the sequence will be integers. 
 A: Notice that $a_1 = \pm 1$. For simplicity, let us write $c = b a_1$. Then consider a sequence $(f_n)$ that solves the recurrence relation
$$ f_{n+2} = c f_{n+1} - f_n, \qquad f_0 = a_0, \quad f_1 = a_1. $$
If we consider matrices
$$ A_n = \begin{pmatrix} f_{n+2} & f_{n+1} \\ f_{n+1} & f_n \end{pmatrix}, \qquad
P = \begin{pmatrix} c & -1 \\ 1 & 0 \end{pmatrix}, $$
then it is easy to check that
$$ A_n = P A_{n-1} = \cdots = P^n A_0. $$
So by taking determinant, we obtain
$$ f_{n+2}f_n - f_{n+1}^2 = \det (A_n) = \det(P)^n \det(A_0) = -1. $$
Then it follows from strong induction that $f_n = a_n$ whenever $a_k \neq 0$ for all $1 \leq k \leq n-2$.

If $a_m = 0$ for some $m$, then this forces that $a_{m + 1}^2 = 1$ and we have freedom to choose any value for $a_{m+2}$. And only in such case we can expect non-integral terms for $(a_n)$. So the problem boils down to determine the values of $b$ for which $f_n = 0$ for some $n \geq 2$.
To this end, we appeal to the general theory to compute the general term of $(f_n)$ and proceed our investigation.


*

*If $|b| = |c| \neq 2$, then we have
$$ f_n = \frac{a_1 (\alpha^n - \beta^n)}{\sqrt{c^2 - 4}}
\qquad \text{where} \quad
\alpha = \frac{c + \sqrt{c^2 - 4}}{2}, \quad
\beta = \frac{c - \sqrt{c^2 - 4}}{2}. $$
In particular, if $|b| = |c| \geq 3$ then $\alpha$ and $\beta$ are real numbers such that $|\beta| \neq |\alpha|$, hence it follows that $f_n \neq 0$ for all $n \geq 1$.
On the other hand, if $|c| = 1$ then $\alpha^6 = \beta^6 = 1$ and hence $f_6 = 0$. The case $|c| = 0$ is much easier to investigate, as $\alpha^2 = \beta^2$ and hence $f_2 = 0$.

*If $|b| = |c| = 2$, then
$$ f_n = n \left(\frac{c}{2}\right)^{n+1}. $$
So it follows that $f_n \neq 0$ for all $n \geq 1$.
Therefore, there exists a sequence $(a_n)$ with non-integral term if and only if $b \in \{-1, 0, 1\}$.
