3. Given the sequence $\left\{a_{n}\right\}$ satisfies:
$$
a_{1}=4, a_{n+1}=2 a_{n}+n^{2} \text {. }
$$

Then the general term formula is $\qquad$
3. $a_{n}=5 \times 2^{n}-n^{2}-2 n-3$.
$$
\begin{array}{l}
\text { Given } a_{n+1}=2 a_{n}+n^{2} \\
\Rightarrow a_{n+1}+(n+1)^{2}+2(n+1)+3 \\
\quad=2\left(a_{n}+n^{2}+2 n+3\right) .
\end{array}
$$

Since $a_{1}+1^{2}+2 \times 1+3=10$, therefore,
$$
\begin{array}{l}
a_{n}+n^{2}+2 n+3=5 \times 2^{n} \\
\Rightarrow a_{n}=5 \times 2^{n}-n^{2}-2 n-3
\end{array}
$$