Determine explicit formulas for the following recursively defined sequences:

(1) $u_{0}=2$ and $u_{n+1}=3 u_{n}^{2}-4 u_{n}+2$;

(2) $u_{0}=\frac{5}{2}$ and $u_{n+1}=u_{n}^{2}-2$.
(1) We try to reduce, through an affine transformation, to a recurrence relation of the type $x_{n+1}=x_{n}^{2}$, which is the simplest a priori among second-degree recurrences. If we set $x_{n}=a y_{n}+b$ and assume that $\left(x_{n}\right)$ satisfies the recurrence relation $x_{n+1}=x_{n}^{2}$, we find that $y_{n+1}=a y_{n}^{2}+2 b y_{n}+\frac{b^{2}-b}{a}$; we see that for $a=3$ and $b=-2$, it is the recurrence relation satisfied by $\left(\mathfrak{u}_{n}\right)$. With $x_{n}=3 u_{n}-2$, we find that $x_{0}=4$ and $x_{n+1}=x_{n}^{2}$, so by immediate induction, $x_{n}=4^{2^{n}}$ and $u_{n}=\frac{4^{2^{n}}+2}{3}$ for all $n$.

(2) The formula found in the previous question shows that we cannot reduce to a recurrence of the type $x_{n+1}=x_{n}^{2}$ via an affine transformation; we need to find something else. The solution lies in the identity $\left(x+\frac{1}{x}\right)^{2}=x^{2}+\frac{1}{x^{2}}+2$: if we set $x_{n}=x^{2^{n}}+\frac{1}{x^{2^{n}}}$ for some complex number $x$, then it is immediate that $x_{n+1}=x_{n}^{2}-2$. It is therefore sufficient to find $x$ such that $x+\frac{1}{x}=\frac{5}{2} ; x=2$ works. We thus have, for all $n, u_{n}=2^{2^{n}}+\frac{1}{2^{2^{n}}}$.

We can thus find explicit formulas for all sequences whose recurrence relation can be reduced, via an affine transformation, to a recurrence of this type. To my knowledge, apart from affine transformation, there are no other second-degree recurrence relations than $x_{n+1}=x_{n}^{2}$ and $x_{n+1}=x_{n}^{2}-2$ for which an explicit formula is known.