login
Sums of three consecutive nonprimes A141468.
3

%I #12 May 05 2019 03:23:57

%S 5,11,18,23,27,31,36,41,45,49,54,59,63,67,71,75,78,81,85,90,95,99,102,

%T 105,109,113,117,121,126,131,135,139,143,147,150,153,157,161,165,168,

%U 171,175,180,185,189,192,195,199,203,207,211,216,221,225,228,231,235

%N Sums of three consecutive nonprimes A141468.

%H G. C. Greubel, <a href="/A166039/b166039.txt">Table of n, a(n) for n = 1..5000</a>

%e a(1) = 0 + 1 + 4 = 5;

%e a(2) = 1 + 4 + 6 = 11;

%e a(3) = 4 + 6 + 8 = 18.

%p A002808 := proc(n) option remember; if n = 1 then 4; else for a from procname(n-1)+1 do if not isprime(a) then return a; fi; od: fi; end: A141468 := proc(n) if n <= 2 then n-1 ; else A002808(n-2) ; fi; end: A166039 := proc(n) add(A141468(j),j=n..n+2) ; end: seq(A166039(n),n=1..120) ; # _R. J. Mathar_, Oct 10 2009

%t With[{nn=100},Total/@Partition[Complement[Range[0,nn],Prime[ Range[ PrimePi[ nn]]]],3,1]] (* _Harvey P. Dale_, Aug 05 2015 *)

%Y Cf. A034961, A141468.

%K nonn

%O 1,1

%A _Juri-Stepan Gerasimov_, Oct 05 2009