login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(1)=0. a(n) = number of earlier terms of the sequence which when added to n produce a composite number.
4

%I #12 Feb 06 2016 17:10:43

%S 0,0,0,3,1,4,2,6,6,7,4,9,5,10,11,12,9,14,11,14,18,17,14,20,18,20,17,

%T 23,18,22,22,26,23,29,26,26,26,30,28,36,23,34,30,34,31,43,30,40,33,37,

%U 43,45,31,46,42,44,40,48,42,48,39,52,47,53

%N a(1)=0. a(n) = number of earlier terms of the sequence which when added to n produce a composite number.

%H G. C. Greubel, <a href="/A115208/b115208.txt">Table of n, a(n) for n = 1..10000</a>

%e Adding 7 to the first 6 terms of the sequence gives [7,7,7,10,8,11]. Of these terms, two are composite, so a(7) = 2.

%t a = {0, 0}; For[n = 3, n < 90, n++, in = 0; For[j = 1, j < Length[a] + 1, j++, If[ ! PrimeQ[n + a[[j]]], in++ ]]; AppendTo[a, in]]; a (* _Stefan Steinerberger_, Jun 03 2007 *)

%Y Cf. A115207, A115209, A115210.

%K nonn

%O 1,4

%A _Leroy Quet_, Jan 16 2006

%E More terms from _Stefan Steinerberger_, Jun 03 2007