22. (2004 Western Mathematical Olympiad) Find all integers $n$, such that $n^{4}+6 n^{3}+11 n^{2}+3 n+31$ is a perfect square.
22. Let $A=n^{4}+6 n^{3}+11 n^{2}+3 n+31$, then $A=\left(n^{2}+3 n+1\right)^{2}-3(n-10)$ is a perfect square. When $n>$ 10, $A\left(n^{2}+3 n+1\right)^{2}$.
If $n \leqslant-3$, or $n \geqslant 0$, then $n^{2}+3 n \geqslant 0$. Thus $A \geqslant\left(n^{2}+3 n+2\right)^{2}, 2 n^{2}+9 n-27 \leqslant 0$,
$$
-7<\frac{-3(\sqrt{33}+3)}{4} \leqslant n \leqslant \frac{3(\sqrt{33}-3)}{4}<3 .
$$

Therefore, $n=-6,-5,-4,-3,0,1,2$, and the corresponding $A=409,166,67,40,31,52,145$ are not perfect squares.
If $n=-2,-1$, the corresponding $A=37,34$ are also not perfect squares.
Thus, only when $n=10$, $A$ is a perfect square.