1. Find all positive integers $n$, such that $3^{n}+n^{2}+2019$ is a perfect square.
（Zou Jin, contributed）
1. If $n$ is odd, then
$$
\begin{array}{l}
3^{n}+n^{2}+2019 \equiv(-1)^{n}+n^{2}+3 \\
\equiv 3(\bmod 4),
\end{array}
$$

it cannot be a perfect square.
Therefore, $n$ is even.
Let $n=2 m\left(m \in \mathbf{Z}_{+}\right)$. Then
$$
\begin{array}{l}
3^{n}+n^{2}+2019=3^{2 m}+4 m^{2}+2019>\left(3^{m}\right)^{2} \\
\Rightarrow 3^{2 m}+4 m^{2}+2019 \geqslant\left(3^{m}+1\right)^{2} \\
\Rightarrow 3^{m}-2 m^{2} \leqslant 1009 .
\end{array}
$$

When $m \geqslant 7$, use mathematical induction to prove:
$$
3^{m}>2 m^{2}+1009 \text {. }
$$

When $m=7$, the conclusion holds.
Assume the proposition holds for $m$, i.e.,
$$
3^{m}>2 m^{2}+1009 \text {. }
$$

When $m+1$,
$$
\begin{array}{l}
3^{m+1}>3\left(2 m^{2}+1009\right)=6 m^{2}+3027 \\
>2(m+1)^{2}+1009 .
\end{array}
$$

Thus, the proposition holds for $m+1$.
Therefore, the inequality is proved.
Hence, $m \leqslant 6$.
When $m=1$,
$$
3^{2 m}+4 m^{2}+2019=2032,
$$

it is not a perfect square.
When $m=2$,
$$
3^{2 m}+4 m^{2}+2019=2116=46^{2} \text {, }
$$

satisfying the condition.
When $m=3$ or 6,
$$
3^{2 m}+4 m^{2}+2019 \equiv 3(\bmod 9),
$$

it is not a perfect square.
When $m=4$,
$$
3^{2 m}+4 m^{2}+2019 \equiv 6(\bmod 7),
$$

it is not a perfect square.
When $m=5$,
$$
3^{2 m}+4 m^{2}+2019 \equiv 3(\bmod 5),
$$

it is not a perfect square.
In summary, the only positive integer that satisfies the condition is $n=4$.