OFFSET
1,1
LINKS
K. D. Bajpai, Table of n, a(n) for n = 1..10000
EXAMPLE
a(1)=17: prime(2+1)^2-prime(2)^2+1= 17, which is prime.
a(6)=313: prime(12+1)^2-prime(12)^2+1= 313, which is prime.
MAPLE
KD:= proc() local a, b, c, d; a:=ithprime(n+1)^2-ithprime(n)^2+1; if isprime(a) then RETURN(a): fi; end:seq(KD(), n=1..500);
MATHEMATICA
Select[Table[Prime[n + 1]^2 - Prime[n]^2 + 1, {n, 10^3}], PrimeQ[#] &]
Select[#[[2]]-#[[1]]+1&/@Partition[Prime[Range[200]]^2, 2, 1], PrimeQ] (* Harvey P. Dale, May 21 2021 *)
PROG
(PARI) for(n=1, 10^3, if(ispseudoprime(k=prime(n+1)^2-prime(n)^2+1), print1(k", ")))
CROSSREFS
KEYWORD
nonn
AUTHOR
K. D. Bajpai, Sep 25 2013
STATUS
approved