9. (2002 China Western Mathematical Olympiad) Find all positive integers $n$, such that $n^{4}-4 n^{3}+22 n^{2}-36 n+18$ is a perfect square.
9. Let $m \in \mathbf{N}$, such that $n^{4}-4 n^{3}+22 n^{2}-36 n+18=m^{2}$. Completing the square, we get $\left(n^{2}-2 n+9\right)^{2}-63=m^{2}$.
Thus, $63=\left(n^{2}-2 n+9\right)^{2}-m^{2}=\left(n^{2}-2 n+9-m\right)\left(n^{2}-2 n+9+m\right)$.
Notice that, $n^{2}-2 n+9+m=(n-1) 2+m+8 \in \mathbf{N}$, so we must have
$$
\left\{\begin{array}{l}
n^{2}-2 n+9-m=1,3,7 \\
n^{2}-2 n+9+m=63,31,9 .
\end{array}\right.
$$

And $n^{2}-2 n+9=31,12$ or 8, solving these respectively gives $n$ can only be 1 or 3 (corresponding to $m=1,9$). Note: After obtaining equation (1), we can also use inequality estimation to handle it.