OFFSET
0,1
LINKS
Harvey P. Dale, Table of n, a(n) for n = 0..100
EXAMPLE
a(0) = 2 because 2 is prime.
a(1) = 1 because 1 is nonprime, but 1 + 1 = 2 is prime.
a(2) = 9 because 9 and 10 are nonprimes, but 11 is prime.
a(3) = 8 because 8, 9 and 10 are nonprimes, but 11 is prime.
MAPLE
for n from 0 to 50 do: ii:=0:for k from 1 to 10000 while(ii=0) do:i:=0:for m from 0 to n while(type(k+m, prime)=false ) do :i:=i+1:od:if i=n then ii:=1: printf(`%d, `, k):else fi:od:od: ~
MATHEMATICA
nn = 50; t = Table[0, {nn}]; cnt = 0; k = 0; While[cnt < nn, k++; i = 0; While[! PrimeQ[k + i], i++]; If[i < nn && t[[i + 1]] == 0, t[[i + 1]] = k; cnt++]]; t (* *** program from T. D. Noe adapted for this sequence - see A233418 *** *)
Flatten[Table[SequencePosition[Table[If[PrimeQ[n], 0, 1], {n, 30000}], PadLeft[ {0}, k, 1], 1], {k, 50}], 1][[All, 1]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, May 20 2018 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, Dec 10 2013
STATUS
approved