OFFSET
1,2
COMMENTS
Primes corresponding to the first four squares are 2, 7, 23, and 136866599. The sequence may be finite.
There may be no square s such that prime(s) + 1 is square (none was found up to 10^9).
This is a Diophantine problem of the form f(n^2) + A = m^2, where f(x) = prime(x), and the simplest case of A = 1 has probably no solutions unlike the same case with f(x) = primepi(x) that may even have an infinite number of solutions.
EXAMPLE
prime(4) + 2 = 7 + 2 = 9, and both 4 and 9 are squares.
MATHEMATICA
Select[Range[10^4]^2, IntegerQ@Sqrt[Prime[#] + 2] &]
PROG
(PARI) for(n=1, 10^4, issquare(prime(n^2)+2)&&print1(n^2 ", "))
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Waldemar Puszkarz, Feb 02 2018
STATUS
approved