4. Given that $n$ is a positive integer, and
$$
n^{4}+2 n^{3}+6 n^{2}+12 n+25
$$

is a perfect square. Then $n=$ $\qquad$
(2014, National Junior High School Mathematics League (Grade 8))
Hint: It is clear that $n=1, n=2$ do not satisfy the problem. Therefore, $n \geqslant 3$.
Solving yields $n=8$.