2. Let $a_{n}=n^{2}+n+2(n=1,2, \cdots)$. Then in the sequence $\left\{a_{n}\right\}$ ().
(A) there are infinitely many prime numbers
(B) there are infinitely many square numbers
(C) there are only finitely many prime numbers
(D) there are only finitely many square numbers
Given $a_{n}=n(n+1)+2$, we know that $a_{n}$ is a composite number. Also, $a_{1}=4$, and when $n \geqslant 2$, $n^{2}<a_{n}<(n+1)^{2}$.
Therefore, the answer is D.