3.2 .10 ** Given the sequence $\left\{a_{n}\right\}$ satisfies $a_{1}=a_{2}=1, a_{n}=\frac{a_{n-1}^{2}+2}{a_{n-2}}(n \geqslant 3)$. Find the general term formula.
From the given conditions, we have $a_{3}=3$ and $a_{n} a_{n-2}=a_{n-1}^{2}+2, a_{n+1} a_{n-1}=a_{n}^{2}+2$. Subtracting the two equations, we eliminate the constant 2, yielding $a_{n+1} a_{n-1}-a_{n} a_{n-2}=a_{n}^{2}-a_{n-1}^{2}$, which simplifies to
$$
a_{n-1}\left(a_{n+1}+a_{n-1}\right)=a_{n}\left(a_{n}+a_{n-2}\right) .
$$

Thus, $\frac{a_{n+1}+a_{n-1}}{a_{n}+a_{n-2}}=\frac{a_{n}}{a_{n-1}}$. Therefore, $\frac{a_{n}+a_{n-2}}{a_{n-1}+a_{n-3}}=\frac{a_{n-1}}{a_{n-2}}, \cdots, \frac{a_{4}+a_{2}}{a_{3}+a_{1}}=\frac{a_{3}}{a_{2}}$.
Multiplying all these equations, we get $\frac{a_{n+1}+a_{n-1}}{a_{3}+a_{1}}=\frac{a_{n}}{a_{2}}$, which simplifies to $a_{n+1}+a_{n-1}=4 a_{n}$.
The characteristic equation for (1) is $x^{2}-4 x+1=0$, with roots $x_{1}=2+\sqrt{3}, x_{2}=2-\sqrt{3}$. Thus,
$$
a_{n}=A_{1}(2+\sqrt{3})^{n}+A_{2}(2-\sqrt{3})^{n} \text {. }
$$

Using the initial conditions $a_{1}-a_{2}=1$, we get $\left\{\begin{array}{l}(2+\sqrt{3}) A_{1}+(2-\sqrt{3}) A_{2}=1, \\ (7+4 \sqrt{3}) A_{1}+(7-4 \sqrt{3}) A_{2}=1 .\end{array}\right.$
Solving these, we find $A_{1}=\frac{5-3 \sqrt{3}}{2 \sqrt{3}}, A_{2}=\frac{5+3 \sqrt{3}}{2 \sqrt{3}}$. Therefore, the general term of the sequence $\left\{a_{n}\right\}$ is
$$
a_{n}=\frac{1}{2 \sqrt{3}}\left[(5-3 \sqrt{3})(2+\sqrt{3})^{n}+(5+3 \sqrt{3})(2-\sqrt{3})^{n}\right] .
$$