Find all triples $(p; q; r)$ of primes such that $pq = r+ 1$ and $2(p ^ 2+q ^ 2) =r ^ 2 + 1$. We have to find all triples $(p; q; r)$ of primes such that $pq = r+ 1$ and $2(p ^ 2+q ^ 2) =r ^ 2 + 1$. This question was asked in the 2013 mumbai region RMO but i could not find a solution to it. Can you please help me out with this?

First, we square the first equation. We have: $p^2q^2=r^2+2r+1$. If we plug $r^2+1$ we would have: $p^2q^2=2(p^2+q^2+r)$. Since $p$ and $q$ are prime numbers and the RHS is even, at least one of them should be $2$. Without loss of generality we take $p=2$. We have: $4q^2=2(4+q^2+r)$ so $q^2=r+4$. If we plug this into the second equation, we have: $2(4+r+4)=r^2+1$ so $r^2-2r+15=0$. The solutions are $r=-3,5$ but $-3$ is not a prime number so $r=5$. Plugging this into the first equation, we get $2q=6$ so $q=3$. Thus, the only triplets would be: $(p,q,r)=(2,3,5),(3,2,5)$P.S.: As Singhal suggested, Technically −3 is a prime. But in here it does not lead to any solutions
