
2. Find all triples $(p, q, r)$ of primes such that $p q=r+1$ and $2\left(p^{2}+q^{2}\right)=r^{2}+1$.


Solution. If $p$ and $q$ are both odd, then $r=p q-1$ is even so $r=2$. But in this case $p q \geq 3 \times 3=9$ and hence there are no solutions. This proves that either $p=2$ or $q=2$. If $p=2$ then we have $2 q=r+1$ and $8+2 q^{2}=r^{2}+1$. Multiplying the second equation by 2 we get $2 r^{2}+2=16+(2 q)^{2}=16+(r+1)^{2}$. Rearranging the terms, we have $r^{2}-2 r-15=0$, or equivalently $(r+3)(r-5)=0$. This proves that $r=5$ and hence $q=3$. Similarly, if $q=2$ then $r=5$ and $p=3$. Thus the only two solutions are $(p, q, r)=(2,3,5)$ and $(p, q, r)=(3,2,5)$.
