OFFSET
1,2
COMMENTS
LINKS
Michel Lagneau, Table of n, a(n) for n = 1..10000
Eric Weisstein's World of Mathematics, Near-Square Prime
MAPLE
i0:=0:
for k from 1 to 1500 do:
p:=k^2+2:
if isprime(p) then printf(`%d, `, k-i0):i0:=k:
else
fi:
od:
MATHEMATICA
Differences[Select[Range[1500], PrimeQ[2 + #^2] &, 100]]
PROG
(PARI) first(m)=my(u=vector(m+1), v=vector(m), r=0); for(i=1, m+1, while(!isprime(r^2 + 2), r++); u[i]=r; r++); for(i=1, m, v[i]=u[i+1]-u[i]); v; \\ Anders Hellström, Aug 14 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, Aug 04 2015
STATUS
approved