OFFSET
1,1
COMMENTS
Conjecture: The number of terms in this sequence is infinite.
That there are infinitely many terms in this sequence would follow from the Legendre conjecture (one of the Landau problems - see the Weisstein link) that there is always a prime between n^2 and (n+1)^2. This is still an open problem. - Max Alekseyev, Apr 20 2006
LINKS
Eric Weisstein's World of Mathematics, Landau's Problems
FORMULA
Let p be a prime number and r = floor(sqrt(p)). Then the closest surrounding squares of p are r^2 and (r+1)^2. So d = (r+1)^2 - r^2 = 2r+1. If d is prime then list p.
EXAMPLE
29 is a prime number. 5^2 and 6^2 are the closest squares surrounding 29. Now the difference 36-25 = 11 is prime so 29 is in the table.
MATHEMATICA
Clear[f, lst, p, n]; f[n_]:=IntegerPart[Sqrt[n]]; lst={}; Do[p=Prime[n]; If[PrimeQ[a=(f[p]+1)^2-f[p]^2], AppendTo[lst, p]], {n, 6!}]; lst (* Vladimir Joseph Stephan Orlovsky, Aug 05 2009 *)
Select[Prime[Range@103], PrimeQ[2*Floor[Sqrt[#]]+1]&] (* Ivan N. Ianakiev, Jul 30 2015 *)
PROG
(PARI) surrsqpr(n) = { local(x, y, j, r, d); forprime(x=2, n, r=floor(sqrt(x)); d=r+r+1; if(isprime(d), print1(x, ", ") ) ) }
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Cino Hilliard, Nov 12 2005
STATUS
approved