OFFSET
2,1
LINKS
Robert Israel, Table of n, a(n) for n = 2..204
MAPLE
P:= select(isprime, [seq(i, i=3..10^7, 2)]):
A:= 'A':
state:= 0: smax := 0:
for i from 2 to nops(P) do
if P[i] - P[i-1] >= 4 then
state:= state + 1;
if state > smax then smax:= state; A[state+1]:= P[i-state] fi
else
state:= 0;
fi
od:
seq(A[i], i=2..smax+1); # Robert Israel, Jun 27 2017
MATHEMATICA
Prime[#]&/@With[{pd=If[#>2, 1, 0]&/@Differences[Prime[Range[3000]]]}, Flatten[ Table[ SequencePosition[pd, PadRight[{}, n, 1], 1][[All, 1]], {n, 45}]]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jul 29 2018 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Jeff Burch, Apr 19 2000
STATUS
approved