cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A133576 Numbers which are sums of consecutive composites.

This page as a plain text file.
%I A133576 #15 Oct 27 2023 09:52:23
%S A133576 4,6,8,9,10,12,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,
%T A133576 32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,48,49,50,51,52,53,54,55,
%U A133576 56,57,58,59,60,62,63,64,65,66,67,68,69,70,71,72,74,75,76,77,78,79,80,81
%N A133576 Numbers which are sums of consecutive composites.
%C A133576 This is to composites A002808 as A034707 is to primes A000040. The complement of this sequence, numbers which are not sums of consecutive composites, begins 1, 2, 3, 5, 7, ... (A140464).
%e A133576 Every composite is in this sequence as one consecutive composite. We account for primes thus:
%e A133576 a(10) = 17 = 8 + 9.
%e A133576 a(12) = 19 = 9 + 10.
%e A133576 a(16) = 23 = 6 + 8 + 9.
%e A133576 a(22) = 29 = 14 + 15.
%e A133576 a(24) = 31 = 9 + 10 + 12.
%e A133576 a(30) = 37 = 4 + 6 + 8 + 9 + 10.
%e A133576 a(34) = 41 = 20 + 21 = 12 + 14 + 15.
%e A133576 a(36) = 43 = 21 + 22.
%e A133576 Not included = 47.
%e A133576 a(45) = 53 = 26 + 27 = 8 + 9 + 10 + 12 + 14.
%e A133576 a(51) = 59 = 18 + 20 + 21 = 6 + 8 + 9 + 10 + 12 + 14.
%e A133576 Not included = 61.
%e A133576 a(58) = 67 = 33 + 34 = 21 + 22 + 24 = 10 + 12 + 14 + 15 + 16.
%e A133576 a(62) = 71 = 35 + 36 = 22 + 24 + 25 = 4 + 6 + 8 + 9 + 10 + 12 + 14.
%e A133576 Not included = 73.
%e A133576 a(69) = 79 = 39 + 40.
%e A133576 a(73) = 83 = 14 + 15 + 16 + 18 + 20.
%e A133576 a(79) = 89 = 44 + 45.
%e A133576 a(87) = 97 = 48 + 49 = 22 + 24 + 25 + 26.
%e A133576 a(91) = 101 = 50 + 51.
%e A133576 a(93) = 103 = 51 + 52.
%p A133576 isA133576 := proc(n)
%p A133576     local i,j ;
%p A133576     for i from 1 do
%p A133576         if A002808(i) > n then
%p A133576             return false;
%p A133576         end if;
%p A133576         for j from i do
%p A133576             s := add( A002808(l),l=i..j) ;
%p A133576             if s > n then
%p A133576                 break;
%p A133576             elif s = n then
%p A133576                 return true;
%p A133576             end if;
%p A133576         end do:
%p A133576     end do:
%p A133576 end proc:
%p A133576 A133576 := proc(n)
%p A133576     local a;
%p A133576     if n = 1 then
%p A133576         return A002808(1) ;
%p A133576     else
%p A133576         for a from procname(n-1)+1 do
%p A133576             if isA133576(a) then
%p A133576                 return a;
%p A133576             end if;
%p A133576         end do:
%p A133576     end if ;
%p A133576 end proc:
%p A133576 seq(A133576(n),n=1..71) ; # _R. J. Mathar_, Feb 14 2015
%t A133576 okQ[n_] := If[CompositeQ[n], True, MemberQ[IntegerPartitions[n, All, Select[Range[n], CompositeQ]], p_List /; Length[p] == Length[Union[p]] && AllTrue[Complement[Range[p[[-1]], p[[1]]], p], PrimeQ]]];
%t A133576 Select[Range[150], okQ] (* _Jean-François Alcover_, Oct 27 2023 *)
%Y A133576 Cf. A002808, A034707, A037174, A140464 (complement).
%K A133576 easy,nonn
%O A133576 1,1
%A A133576 _Jonathan Vos Post_, Dec 26 2007