23. For each positive integer $n \geq 1$, we define the recursive relation given by
$$
a_{n+1}=\frac{1}{1+a_{n}} \text {. }
$$

Suppose that $a_{1}=a_{2012}$. Find the sum of the squares of all possible values of $a_{1}$.
23. Answer: 3.
Let $a_{1}=a$. Then $a_{2}=\frac{1}{1+a}, a_{3}=\frac{1+a}{2+a}, a_{4}=\frac{2+a}{3+2 a}, a_{5}=\frac{3+2 a}{5+3 a}, \ldots$. In general,
$$
a_{n}=\frac{F_{n}+F_{n-1} a}{F_{n+1}+F_{n} a}
$$
where $F_{1}=0, F_{2}=1$ and $F_{n+1}=F_{n}+F_{n-1}$ for all $n \geq 1$.
If $a_{2012}=\frac{F_{2012}+F_{2011} a}{F_{2013}+F_{2012} a}=a$, then $\left(a^{2}+a-1\right) F_{2012}=0$.
Since $F_{2012}>0$, we have $a^{2}+a-1=0$. Let $\alpha$ and $\beta$ be the roots of $a^{2}+a-1=0$. Then
$$
\alpha^{2}+\beta^{2}=(\alpha+\beta)^{2}-2 \alpha \beta=(-1)^{2}-2(-1)=3
$$