31. [15] Find the sum of all primes $p$ for which there exists a prime $q$ such that $p^{2}+p q+q^{2}$ is a square.
Answer: 83 and 5 both work, because $3^{2}+3 \cdot 5+5^{2}=49$. Now, say $p^{2}+p q+q^{2}=k^{2}$, for a positive integer $k$. Then $(p+q)^{2}-k^{2}=p q$, or:
$$
(p+q+k)(p+q-k)=p q
$$

Since $p+q+k$ is a divisor of $p q$, and it is greater than $p$ and $q, p+q+k=p q$. Then $p+q-k=1$. So:
$$
2 p+2 q=p q+1 \Leftrightarrow p q-2 p-2 q+4=3 \Leftrightarrow(p-2)(q-2)=3
$$

This shows that one of $p$ and $q$ is 3 and the other is 5 .