All primes $p,q,r$ such that $(p-q)^2+1=r$ How can one find all prime numbers $p,q,$ and $r$ such that
$$(p-q)^2+1=r\ ?$$
 A: The Hardy-Littlewood conjecture E says that there are infinitely many primes of the form $n^2+1$ (and gives an asymptotic density); de Polignac's conjecture says that there are infinitely many primes, indeed consecutive primes, with a specified even distance.  So on these conjectures there are infinitely many $r$ such that $r-1$ is a perfect square, and for any such choice ($r\neq2$) there are infinitely many $p,q$ such that $(p-q)^2+1=r.$
A: Yuval is right, this question is very hard. Breaking it up into 3 cases:


*

*$r - 1$ is not a perfect square, in which case there are no solutions.

*$r - 1$ is a perfect square and $r$ is even, in which case $p - q$ is odd and so one of them (say $q$, noting that if $(p,q)$ is a solution then $(q,p)$ is as well) is $2$ and so $p = 2 + \sqrt{r - 1}$, which may or may not be a solution. If it is a solution, it is unique aside from switching the order of $p$ and $q$.

*$r - 1$ is a perfect square and $r$ is odd. This problem is open for all such values of $r$.


Edit: As Zev pointed out, $r$ even $\implies r = 2$ because if $r > 2$ we have $r - 2 = (p - q - 1)(p - q + 1)$ is even thus both terms $(p - q - 1),(p - q + 1)$ are and so we can continue to factor out $2$, i.e. $2^n | r - 2$ for all $n > 1$, a clear contradiction.
