The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A115207 a(1)=1. a(n) = number of earlier terms of the sequence which when added to n produce a composite number. 4
 1, 0, 1, 1, 3, 2, 5, 5, 7, 4, 8, 5, 10, 9, 11, 10, 14, 10, 13, 16, 14, 16, 18, 18, 19, 20, 16, 20, 21, 23, 23, 25, 23, 27, 30, 23, 27, 27, 31, 27, 33, 31, 31, 33, 37, 31, 41, 31, 41, 39, 40, 34, 43, 45, 47, 36, 45, 40, 50, 43, 51, 44, 47, 50, 56, 41, 56, 53, 55, 47, 61, 55, 60, 57 (list; graph; refs; listen; history; text; internal format)
 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 Cf. A115208, A115209, A115210. Sequence in context: A196438 A019828 A289627 * A093048 A141732 A325695 Adjacent sequences:  A115204 A115205 A115206 * A115208 A115209 A115210 KEYWORD nonn AUTHOR Leroy Quet, Jan 16 2006 EXTENSIONS More terms from Matthew Conroy, Feb 09 2006 STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified September 25 17:57 EDT 2021. Contains 347659 sequences. (Running on oeis4.)