OFFSET
0,5
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..10000
EXAMPLE
Adding 6 to the first 6 terms (terms 0 through 5) of the sequence gives [6,6,6,6,10,7]. Of these terms, five are composite, so a(6) = 5.
MATHEMATICA
a = {0, 0, 0, 0}; For[n = 4, n < 10001, n++, in = 0; For[j = 1, j < Length[a] + 1, j++, If[! PrimeQ[n + a[[j]]], in++]]; AppendTo[a, in]];
a (* G. C. Greubel, Feb 05 2016 *)
PROG
(PARI) seq=vector(200); print1(0, ", "); for(j=1, 190, count=0; for(k=0, j-1, if(isprime(j+seq[k+1])==0 && (j+seq[k+1])>1, count=count+1; )); seq[j+1]=count; print1(seq[j+1], ", ")) \\ Matthew Conroy, Feb 07 2006
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Jan 16 2006
EXTENSIONS
More terms from Matthew Conroy, Feb 07 2006
STATUS
approved