OFFSET
0,1
LINKS
Robert G. Wilson v, Table of n, a(n) for n = 0..180
FORMULA
a(n) = A256454(n)+2n for n>0. - Robert G. Wilson v, Mar 30 2015
EXAMPLE
149 - 139 = 10, the first time this gap was seen after smaller gaps of 1,2,4,6,8.
MAPLE
A[0]:= 3:
p:=3:
n:= 1:
for i from 1 to 10^5 do
q:= nextprime(p);
gap:= q - p;
if gap = 2*n then
A[n]:= q;
n:= n+1;
fi;
p:= q;
od:
seq(A[i], i=1..n); # Robert Israel, Jan 18 2015
MATHEMATICA
lst = {3}; p = 2; q = 3; gp = 2; While[gp != 1000, While[q - p != gp, p = q; q = NextPrime@ p]; AppendTo[lst, q]; Print@ q; gp += 2]; lst (* Robert G. Wilson v, Jan 23 2015 *)
PROG
(PARI) genit(maxx)={n=3; delta=2; print1(n, ", "); ptr=1; while(delta<maxx, p=prime(n-1); q=nextprime(p+1); if(delta==q-p, print1(q, ", "); delta+=2; ptr++); n++); }
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Bill McEachen, Jan 17 2015
STATUS
approved