Just came across the following question:
Suppose $p$ is a prime number and $p+1$ is a perfect square. Find the sum of all such prime numbers.
This is simple and there is a unique $p$, namely $p=3$.
Now I come to my question:
Suppose $p$ is a prime number and $p+2$ is a perfect square. Are there are infinitely many of such primes $p$?
Or in general,
Is there a way to determine if there are infinitely many of prime numbers $p$ such that $p+a=k^2$ for some positive integers $a$ and $k$.
Edit: For the special case that $p$ is a prime number and that $p+b^2$ is a perfect square, one can prove that there is a unique solution if $2b+1$ is prime, or else there is no solution.