OFFSET
1,2
FORMULA
EXAMPLE
a(1)=1 because (1st prime+1)^2 - (1st prime)^2=5 is prime and (1st prime+1)^2 + (1st prime)^2=13 is prime;
a(2)=3 because (3rd prime+1)^2 - (3rd prime)^2=11 is prime and (3rd prime+1)^2 + (3rd prime)^2=61 is prime;
a(3)=10 because (10th prime+1)^2 - (10th prime)^2=59 is prime and (10th prime+1)^2 + (10th prime)^2=1741 is prime;
a(4)=128 because (128th prime+1)^2 - (128th prime)^2=1439 is prime and (128th prime+1)^2 + (128th prime)^2=1035361 is prime.
MATHEMATICA
npsQ[n_]:=Module[{np=Prime[n], a, b}, a=np^2; b=(np+1)^2; And@@PrimeQ[ {a+b, b-a}]]; Select[Range[5000], npsQ] (* Harvey P. Dale, Sep 11 2011 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Juri-Stepan Gerasimov, Mar 01 2010
EXTENSIONS
Extended beyond a(4) by R. J. Mathar, Mar 09 2010
STATUS
approved