3. Let $a_{0}=a, a_{n+1}=2 a_{n}-n^{2}(n=0,1,2$, $\cdots)$, if all terms of $\left\{a_{n}\right\}$ are positive integers, then the minimum value of $\left\{a_{n}\right\}$ is $\qquad$
3. Solution: It is easy to know that $a_{n+1}-(n+1)^{2}=2 a_{n}-2 n^{2}-2 n-1$, so $a_{n+1}-(n+1)^{2}-2(n+1)=2\left(a_{n}-n^{2}\right)-4 n-3$, which means $a_{n+1}-(n+1)^{2}-2(n+1)-3=2\left(a_{n}-n^{2}-2 n-3\right)$, after substitution, the general term of $\left\{a_{n}\right\}$ can be solved as $a_{n}=n^{2}+2 n+3+(a-3) \cdot 2^{n}(n \in \mathbf{N})$. From $a_{n}>0$, we get $3-a<\frac{n^{2}+2 n+3}{2^{n}}$ for all $n \in \mathbf{N}$, hence $a \geqslant 3$. In this case, $\left\{a_{n}\right\}$ is monotonically increasing, so its minimum value is 3.