OFFSET
1,5
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..10000
EXAMPLE
Adding 7 to the first 6 terms of the sequence gives [8,7,8,8,10,9]. Of these terms, five are composite, so a(7) = 5.
MATHEMATICA
a = {1, 0}; For[n = 3, 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); seq[1]=1; print1(1, ", "); for(j=1, 190, count=0; for(k=1, j, if(isprime(j+1+seq[k])==0 && (j+1+seq[k])>1, count=count+1; )); seq[j+1]=count; print1(seq[j+1], ", ")) \\ Matthew Conroy, Feb 09 2006
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Jan 16 2006
EXTENSIONS
More terms from Matthew Conroy, Feb 09 2006
STATUS
approved