A recurrence relation question - transforming $a_{n+1}+{a_n}^2-2a_n=0$

I guess it is solved by transforming $a_n$ to some form of $b_n$. But I could not see the way. Would you explain the solution in details? Thanks.
Note that
$$\begin{align}
a_{n+1}+{a_n}^2-2a_n=0 &amp; \iff a_{n+1} = -a_n^2 + 2a_n \\
&amp; \iff a_{n+1}=-(a_n^2-2a_n+1)+1 \\
&amp; \iff a_{n+1}=-(a_n-1)^2+1 \\
\end{align}$$
and a simple heurist reasoning suggests that
$$a_n \approx -( \ldots ((a_0^2)^2)^2 \ldots )^2 = -a_1 ^ {2^n}$$

Now, since solving quadratic recurrence relation is quite hopeless  because most quadratic maps are not solvable (however there are some tricks you can try) the first thing to try is to give some values, and one can see that
$$\begin{cases}
a_1 = 1 \Rightarrow a_n = 1 \qquad \forall n \in \mathbb{N}\\
a_1 = 2 \Rightarrow a_n = 0 \qquad \forall n \in \mathbb{N}, n \ge 2\\
a_1 = 3 \Rightarrow a_2 = -3, a_3 = -15, a_4 = -255, a_5 = 65535 \ldots
\end{cases}$$
and it's clearly visible a pattern $\ldots$
$$a_{n} = -(a_1 -1)^{2^n}+1$$
Note that
$$\begin{align}
a_{n+1}+{a_n}^2-2a_n=0 &amp; \iff a_{n+1} = -a_n^2 + 2a_n \\
&amp; \iff a_{n+1}=-(a_n^2-2a_n+1)+1 \\
&amp; \iff a_{n+1}=-(a_n-1)^2+1 \\
\end{align}$$
and a simple heurist reasoning suggests that
$$a_n \approx -( \ldots ((a_0^2)^2)^2 \ldots )^2 = -a_1 ^ {2^n}$$

Now, since solving quadratic recurrence relation is quite hopeless  because most quadratic maps are not solvable (however there are some tricks you can try) the first thing to try is to give some values, and one can see that
$$\begin{cases}
a_1 = 1 \Rightarrow a_n = 1 \qquad \forall n \in \mathbb{N}\\
a_1 = 2 \Rightarrow a_n = 0 \qquad \forall n \in \mathbb{N}, n \ge 2\\
a_1 = 3 \Rightarrow a_2 = -3, a_3 = -15, a_4 = -255, a_5 = 65535 \ldots
\end{cases}$$
and it's clearly visible a pattern $\ldots$
$$a_{n} = -(a_1 -1)^{2^n}+1$$