Difficult Recurrence Problem Find all integers $n\geq 3$ for which there exist real numbers $a_{1}, a_{2},...,a_{n+2}$ satisfying $a_{n+1}=a_{1}$ , $a_{n+2}=a_{2}$ and:
$a_{i}a_{i+1}+1=a_{i+2}$
for $i=1,2,..,n$

Hint.
Solving backwards we have for 
$$
\begin{cases}
n=2\to \{2,-1,-1,2\}\\
n=5\to \{2,-1,-1,2,\frac 12,-1,2\}\\
n=8\to \{2,-1,-1,2,\frac 12,-1,2,\frac 12,-1,2\}\\
\vdots\\
n=2+3k\to \{2,-1,\underbrace{-1,2,\frac 12}_{k},-1,2\}
\end{cases}
$$
NOTE
The real solutions arise from
$$
\left\{
\begin{array}{rcl}
 a_1&=&\frac{a_2-1}{a_1} \\
 a_2&=&1-\frac{a_1}{a_2-1} \\
\end{array}
\right.
$$
the other possibilities 
$$
\left\{
\begin{array}{c}
 a_1=1-\frac{a_1}{a_2-1} \\
 a_2=\frac{a_1}{a_1-a_2+1} \\
\end{array}
\right.
\ \ \text{and}\ \ \left\{
\begin{array}{c}
 a_1=\frac{a_1}{a_1-a_2+1} \\
 a_2=\frac{a_2-1}{a_1} \\
\end{array}
\right.
$$
have no real solutions.
