We define $f: \mathbb{N}\to \mathbb{N}$ as:
$f(n) =3^n+n^2+2019$
Lemma 1. if $x$ is square then $x \equiv 1 $ (mod 4) or $x \equiv 0$ (mod4).
Proof. $r = 2k \Rightarrow r^2\equiv 0$(mod 4) $r = 2k+1 \Rightarrow r^2\equiv 1$(mod 4) .$\square$
Proposition 1. if $f(n)$ is square then $ n = 2k $.
Proof.$f(2k+1) = 3^{2k+1}+(2k+1)^2+2019\equiv 3+1+3 \equiv 3 $ (mod 4)
$f(2k) = 3^{2k}+(2k)^2+2019\equiv 1+0+3 \equiv 0 $ (mod 4).$\square$
Theorem 1 . For $k\ge 4$ then $3^{2k}< f(2k) < (3^k +1)^2$
Proof. it is clear that $ 3^{2k} < 3^{2k} + (2k)^2 + 2019 $ now we proof $f(2k) < (3^k +1)^2$ by induction:
$$ k =4 : f(2k) = 3^{2k}+(2k)^2+2019 < 3^{2k} + 2\cdot 3^{k} +1 \Leftrightarrow (2k)^2+2019< 2\cdot 3^{k} +1 $$
$$(2k)^2+2019 = 8^2 +2019 < 80\cdot 80 = 6400 < 81^2 + 1< 2\cdot 3^{k} +1
$$
so for $k = 4 $ it is correct now assume for $k $ it's true for $k+1 $ we have:
$$
f(2k+2) < 3^{2k} + 2\cdot 3^{k} +1 \Rightarrow (3^{k+2} +1)^2 > 9(3^{2k} + 2\cdot 3^{k} )+ 1 > 9(3^{2k}+(2k)^2+2018)+1 $$
$$
\Leftrightarrow (3^{k+2} +1)^2> 3^{2(k+1) } +9 (2k)^2+2019 $$
and it is obvious that $ 9 (2k)^2 = 36k^2>16k^2 = 4k^2 + 8k^2 + 4k^2 > 4k^2 + 4k+4 = (2k+2) ^2$
So we got:
$$
(3^{k+2} +1)^2 >3^{2(k+1) } + (2k+2)^2+2019$$.$\square$
Know we should check $n\in \{2,4,6\}$ because by Theorem 1 we proof that if $n \in \{8,10,12 ,\cdots\}$ then $f(n)$ is between two consecutive squares so it can't be square now we have:
$n =2 : 45^2 = 2025< f(2) = 2032 < 2116 = 46^2$
$n= 4 : f(4) = 2116= 46^2$ it is square
$n =6 : 45^2 = 52^2 = 2704< f(2) = 2784 < 2809 = 53^2$
So just if $n =4$ then $f(n) $ is square!