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?

Well, $r^2+1=2(p^2+q^2)$ is even, so $r^2$ is odd, and so $r$ is odd. But then $pq=r-1$ is even. Thus, $p$ and/or $q$ must be an even prime.
What happens next depends on whether you are considering negative numbers as potential primes. I will proceed as though you are. Let's assume that $p$ is an even prime, so that $p^2=4.$ Squaring the first equation then shows us that $$4q^2=r^2+2r+1,$$ while multiplying the second equation by $2$ gives us $$16+4q^2=2r^2+2,$$ meaning $$4q^2=2r^2-14.$$ Thus, $$2r^2-14=r^2+2r+1\\r^2-2r-15=0\\(r-5)(r+3)=0$$ and so either $r=5$ or $r=-3.$ But we cannot have $r=-3,$, though, since then we would have $$4q^2=r^2+2r-1=9-6+1=4,$$ so $q^2=1,$ which is impossible, since $q$ is prime. Thus, we must have $r=5.$ So, our original equations become $$pq=6$$ and $$8+2q^2=26.$$ Hence, we find the triples $(2,3,5)$ and $(-2,-3,5).$
Assuming that $q$ is an even prime likewise gets us the triples $(3,2,5)$ and $(-3,-2,5).$
From the work above, we can also see that there are only two viable triples if we are not considering negative numbers as potential primes.
