10 (21 points) Given the positive sequence $\left\{a_{n}\right\}$ satisfies $a_{1}=1, a_{2}=2, a_{n}=\frac{a_{n-2}}{a_{n-1}}$, $n \geqslant 3$. Find the general formula for $a_{n}$.


10 Let $b_{n}=\log _{2} a_{n}$, then we have $b_{1}=0, b_{2}=1, b_{n}=-b_{n-1}+b_{n-2}$, $n \geqslant 3$. Let $\lambda, \mu$ be the roots of the equation $x^{2}=-x+1$, i.e., $\lambda, \mu=-\frac{1 \pm \sqrt{5}}{2}$, then
$$
\begin{array}{l}
\left\{\begin{array}{l}
b_{n}-\lambda b_{n-1}=\mu\left(b_{n-1}-\lambda b_{n-2}\right)=\cdots=\mu^{n-2}\left(b_{2}-\lambda b_{1}\right), \\
b_{n}-\mu b_{n-1}=\lambda\left(b_{n-1}-\mu b_{n-2}\right)=\cdots=\lambda^{n-2}\left(b_{2}-\mu b_{1}\right),
\end{array}\right. \\
\Rightarrow b_{n}=\frac{\lambda^{n-1}-\mu^{n-1}}{\lambda-\mu}, a_{n}=2^{\frac{\lambda^{n-1}-\mu^{n-1}}{\lambda-\mu}} .
\end{array}
$$