12. The sequence $\left\{a_{n}\right\}$ is defined as follows: $a_{0}=1, a_{1}=2, a_{n+2}=a_{n}+a_{n+1}^{2}$, then $a_{2006} \equiv$ $\qquad$ $(\bmod 7)$
12. 6

Hint: $a_{0} \equiv 1(\bmod 7), a_{1} \equiv 2(\bmod 7)$,
$$
\begin{array}{l}
a_{2} \equiv 2^{2}+1 \equiv 5(\bmod 7), a_{3} \equiv 6(\bmod 7), \\
a_{4} \equiv 6(\bmod 7), a_{5} \equiv 0(\bmod 7), \\
a_{6} \equiv 6(\bmod 7), a_{7} \equiv 1(\bmod 7), \\
a_{8} \equiv 2(\bmod 7) .
\end{array}
$$

Therefore, $a_{n+7} \equiv a_{n}(\bmod 7)$, so $a_{2006} \equiv a_{7 \times 286+4} \equiv a_{4} \equiv 6(\bmod 7)$.