10. All prime numbers $p$ that make $\frac{p(p+1)+2}{2}$ a perfect square are $\qquad$ .
10.2 or 5.

Let $\frac{p(p+1)+2}{2}=k^{2}\left(k \in \mathbf{Z}_{+}\right)$. Then $p(p+1)=2 k^{2}-2=2(k+1)(k-1)$.
(1) When $p=2$, $3=k^{2}-1, k=2$;
(2) When $p \neq 2$, $p \mid(k+1)$ or $p \mid(k-1)$. If $p \mid(k+1)$, then $p+1 \geqslant 2(k-1)$. Thus, $k+2 \geqslant p+1 \geqslant 2(k-1) \Rightarrow k \leqslant 4$.
When $k=3$, $p(p+1)=16$, no prime solution;
When $k=4$, $p(p+1)=30, p=5$.
If $p \mid(k-1)$, then $k \geqslant p+1 \geqslant 2(k+1)$, which is impossible.

In summary, $p=2$ or 5.