OFFSET
1,1
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
EXAMPLE
7-4=3, 9-7=2; 11-9=2, 16-11=5; 23-16=7, 25-23=2; ..
MATHEMATICA
Clear[f, lst, p, n]; f[n_]:=IntegerPart[Sqrt[n]]; lst={}; Do[p=Prime[n]; If[PrimeQ[p-f[p]^2]&&PrimeQ[(f[p]+1)^2-p], AppendTo[lst, p]], {n, 8!}]; lst
spQ[n_]:=Module[{lsq=Floor[Sqrt[n]]}, And@@PrimeQ[{n-lsq^2, (lsq+1)^2-n}]]; Select[Prime[Range[140000]], spQ] (* Harvey P. Dale, May 08 2011 *)
PROG
(PARI) forstep(n=3, 1e6, 2, if(isprime(2*n-3)&&isprime(k=n^2-2), print1(k", ")); if(isprime(2*n-1)&&isprime(k=n^2+2), print1(k", ")))
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladimir Joseph Stephan Orlovsky, Aug 05 2009
EXTENSIONS
Program and editing by Charles R Greathouse IV, Nov 02 2009
STATUS
approved