A333224
Number of distinct positive consecutive subsequence-sums of the k-th composition in standard order.
Original entry on oeis.org
0, 1, 1, 2, 1, 3, 3, 3, 1, 3, 2, 4, 3, 4, 4, 4, 1, 3, 3, 5, 3, 5, 4, 5, 3, 4, 5, 5, 5, 5, 5, 5, 1, 3, 3, 5, 2, 5, 5, 6, 3, 6, 3, 6, 5, 6, 5, 6, 3, 4, 6, 6, 5, 6, 6, 6, 5, 6, 6, 6, 6, 6, 6, 6, 1, 3, 3, 5, 3, 6, 6, 7, 3, 5, 5, 7, 4, 6, 6, 7, 3, 6, 4, 7, 5, 7, 6
Offset: 0
The composition (4,3,1,2) has positive subsequence-sums 1, 2, 3, 4, 6, 7, 8, 10, so a(550) = 8.
Compositions where every subinterval has a different sum are counted by
A169942 and
A325677 and ranked by
A333222. The case of partitions is counted by
A325768 and ranked by
A325779.
Positive subset-sums of partitions are counted by
A276024 and
A299701.
Knapsack compositions are counted by
A325676 and
A325687 and ranked by
A333223. The case of partitions is counted by
A325769 and ranked by
A325778, for which the number of distinct consecutive subsequences is given by
A325770.
Allowing empty subsequences gives
A333257.
Cf.
A000120,
A003022,
A029931,
A048793,
A066099,
A070939,
A103295,
A124767,
A143823,
A295235,
A325680,
A333217.
-
stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
Table[Length[Union[ReplaceList[stc[n],{_,s__,_}:>Plus[s]]]],{n,0,100}]
A325862
Number of integer partitions of n such that every set of distinct parts has a different sum.
Original entry on oeis.org
1, 1, 2, 3, 5, 7, 10, 14, 19, 26, 34, 46, 58, 77, 93, 122, 146, 188, 217, 282, 327, 410, 470, 596, 673, 848, 947, 1178, 1325, 1629, 1798, 2213, 2444, 2962, 3247, 3935, 4292, 5149, 5579, 6674, 7247, 8590, 9221, 10964, 11804, 13870, 14843, 17480, 18675, 21866
Offset: 0
The a(1) = 1 through a(7) = 14 partitions:
(1) (2) (3) (4) (5) (6) (7)
(11) (21) (22) (32) (33) (43)
(111) (31) (41) (42) (52)
(211) (221) (51) (61)
(1111) (311) (222) (322)
(2111) (411) (331)
(11111) (2211) (421)
(3111) (511)
(21111) (2221)
(111111) (4111)
(22111)
(31111)
(211111)
(1111111)
The three non-knapsack partitions counted under a(6) are:
(2,2,1,1)
(3,1,1,1)
(2,1,1,1,1)
Cf.
A002033,
A034444,
A196723,
A275972,
A276024,
A299702,
A325592,
A325856,
A325863,
A325864,
A325865,
A325877.
-
Table[Length[Select[IntegerPartitions[n],UnsameQ@@Plus@@@Subsets[Union[#]]&]],{n,0,20}]
A325687
Triangle read by rows where T(n,k) is the number of length-k compositions of n such that every distinct consecutive subsequence has a different sum.
Original entry on oeis.org
1, 1, 1, 1, 2, 1, 1, 3, 0, 1, 1, 4, 4, 0, 1, 1, 5, 5, 0, 0, 1, 1, 6, 12, 4, 0, 0, 1, 1, 7, 12, 5, 0, 0, 0, 1, 1, 8, 25, 8, 4, 0, 0, 0, 1, 1, 9, 24, 12, 3, 0, 0, 0, 0, 1, 1, 10, 40, 32, 8, 4, 0, 0, 0, 0, 1, 1, 11, 41, 41, 6, 3, 0, 0, 0, 0, 0, 1
Offset: 1
The distinct consecutive subsequences of (1,1,3,3) are (1), (1,1), (3), (1,3), (1,1,3), (3,3), (1,3,3), (1,1,3,3), all of which have different sums, so (1,1,3,3) is counted under a(8).
Triangle begins:
1
1 1
1 2 1
1 3 0 1
1 4 4 0 1
1 5 5 0 0 1
1 6 12 4 0 0 1
1 7 12 5 0 0 0 1
1 8 25 8 4 0 0 0 1
1 9 24 12 3 0 0 0 0 1
1 10 40 32 8 4 0 0 0 0 1
1 11 41 41 6 3 0 0 0 0 0 1
1 12 60 76 14 4 4 0 0 0 0 0 1
1 13 60 88 16 6 3 0 0 0 0 0 0 1
Row n = 8 counts the following compositions:
(8) (17) (116) (1115) (11111111)
(26) (125) (1133)
(35) (143) (2222)
(44) (152) (3311)
(53) (215) (5111)
(62) (233)
(71) (251)
(332)
(341)
(512)
(521)
(611)
-
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n,{k}],UnsameQ@@Total/@Union[ReplaceList[#,{_,s__,_}:>{s}]]&]],{n,15},{k,n}]
A326017
Triangle read by rows where T(n,k) is the number of knapsack partitions of n with maximum k.
Original entry on oeis.org
1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 2, 1, 1, 0, 1, 1, 1, 2, 1, 1, 0, 1, 1, 2, 3, 2, 1, 1, 0, 1, 1, 2, 1, 3, 2, 1, 1, 0, 1, 1, 2, 2, 4, 3, 2, 1, 1, 0, 1, 1, 2, 3, 1, 4, 3, 2, 1, 1, 0, 1, 1, 3, 3, 4, 6, 4, 3, 2, 1, 1, 0, 1, 1, 1, 1, 3, 1, 6, 4
Offset: 0
Triangle begins:
1
0 1
0 1 1
0 1 1 1
0 1 1 1 1
0 1 1 2 1 1
0 1 1 1 2 1 1
0 1 1 2 3 2 1 1
0 1 1 2 1 3 2 1 1
0 1 1 2 2 4 3 2 1 1
0 1 1 2 3 1 4 3 2 1 1
0 1 1 3 3 4 6 4 3 2 1 1
0 1 1 1 1 3 1 6 4 3 2 1 1
0 1 1 3 3 5 4 7 6 4 3 2 1 1
0 1 1 2 3 5 4 1 7 6 4 3 2 1 1
0 1 1 2 3 4 6 6 11 7 6 4 3 2 1 1
Row n = 9 counts the following partitions:
(111111111) (22221) (333) (432) (54) (63) (72) (81) (9)
(3222) (441) (522) (621) (711)
(531) (6111)
(51111)
-
ks[n_]:=Select[IntegerPartitions[n],UnsameQ@@Total/@Union[Subsets[#]]&];
Table[Length[Select[ks[n],Length[#]==k==0||Max@@#==k&]],{n,0,15},{k,0,n}]
A325690
Number of length-3 integer partitions of n whose largest part is not the sum of the other two.
Original entry on oeis.org
0, 0, 0, 1, 0, 2, 2, 4, 3, 7, 6, 10, 9, 14, 13, 19, 17, 24, 23, 30, 28, 37, 35, 44, 42, 52, 50, 61, 58, 70, 68, 80, 77, 91, 88, 102, 99, 114, 111, 127, 123, 140, 137, 154, 150, 169, 165, 184, 180, 200, 196, 217, 212, 234, 230, 252, 247, 271, 266, 290, 285, 310
Offset: 0
The a(3) = 1 through a(13) = 14 partitions (A = 10, B = 11):
(111) (221) (222) (322) (332) (333) (433) (443) (444) (544)
(311) (411) (331) (521) (432) (442) (533) (543) (553)
(421) (611) (441) (622) (542) (552) (643)
(511) (522) (631) (551) (732) (652)
(531) (721) (632) (741) (661)
(621) (811) (641) (822) (733)
(711) (722) (831) (742)
(731) (921) (751)
(821) (A11) (832)
(911) (841)
(922)
(931)
(A21)
(B11)
-
Table[Length[Select[IntegerPartitions[n,{3}],#[[1]]!=#[[2]]+#[[3]]&]],{n,0,30}]
A326034
Number of knapsack partitions of n with largest part 3.
Original entry on oeis.org
0, 0, 0, 1, 1, 2, 1, 2, 2, 2, 2, 3, 1, 3, 2, 2, 2, 3, 1, 3, 2, 2, 2, 3, 1, 3, 2, 2, 2, 3, 1, 3, 2, 2, 2, 3, 1, 3, 2, 2, 2, 3, 1, 3, 2, 2, 2, 3, 1, 3, 2, 2, 2, 3, 1, 3, 2, 2, 2, 3, 1, 3, 2, 2, 2, 3, 1, 3, 2, 2, 2, 3, 1, 3, 2, 2, 2, 3, 1, 3, 2, 2, 2, 3, 1, 3, 2
Offset: 0
The initial values count the following partitions:
3: (3)
4: (3,1)
5: (3,2)
5: (3,1,1)
6: (3,3)
7: (3,3,1)
7: (3,2,2)
8: (3,3,2)
8: (3,3,1,1)
9: (3,3,3)
9: (3,2,2,2)
10: (3,3,3,1)
10: (3,3,2,2)
11: (3,3,3,2)
11: (3,3,3,1,1)
11: (3,2,2,2,2)
12: (3,3,3,3)
13: (3,3,3,3,1)
13: (3,3,3,2,2)
13: (3,2,2,2,2,2)
14: (3,3,3,3,2)
14: (3,3,3,3,1,1)
15: (3,3,3,3,3)
15: (3,2,2,2,2,2,2)
-
sums[ptn_]:=sums[ptn]=If[Length[ptn]==1,ptn,Union@@(Join[sums[#],sums[#]+Total[ptn]-Total[#]]&/@Union[Table[Delete[ptn,i],{i,Length[ptn]}]])];
kst[n_]:=Select[IntegerPartitions[n,All,{1,2,3}],Length[sums[Sort[#]]]==Times@@(Length/@Split[#]+1)-1&];
Table[Length[Select[kst[n],Max@@#==3&]],{n,0,30}]
A326035
Number of uniform knapsack partitions of n.
Original entry on oeis.org
1, 1, 2, 3, 4, 4, 6, 6, 9, 10, 12, 12, 17, 16, 20, 25, 27, 29, 35, 39, 44, 57, 53, 66, 75, 84, 84, 114, 112, 131, 133, 162, 167, 209, 192, 242, 250, 289, 279, 363, 348, 417, 404, 502, 487, 608, 557, 706, 682, 835, 773, 1004, 922, 1149, 1059, 1344, 1257, 1595
Offset: 0
The a(1) = 1 through a(8) = 9 partitions:
(1) (2) (3) (4) (5) (6) (7) (8)
(11) (21) (22) (32) (33) (43) (44)
(111) (31) (41) (42) (52) (53)
(1111) (11111) (51) (61) (62)
(222) (421) (71)
(111111) (1111111) (521)
(2222)
(3311)
(11111111)
-
sums[ptn_]:=sums[ptn]=If[Length[ptn]==1,ptn,Union@@(Join[sums[#],sums[#]+Total[ptn]-Total[#]]&/@Union[Table[Delete[ptn,i],{i,Length[ptn]}]])];
ks[n_]:=Select[IntegerPartitions[n],Length[sums[Sort[#]]]==Times@@(Length/@Split[#]+1)-1&];
Table[Length[Select[ks[n],SameQ@@Length/@Split[#]&]],{n,30}]
A334268
Number of compositions of n where every distinct subsequence (not necessarily contiguous) has a different sum.
Original entry on oeis.org
1, 1, 2, 4, 5, 10, 10, 24, 24, 43, 42, 88, 72, 136, 122, 242, 213, 392, 320, 630, 490, 916, 742, 1432, 1160, 1955, 1604, 2826, 2310, 3850, 2888, 5416, 4426, 7332, 5814, 10046, 7983, 12946, 10236, 17780, 14100, 22674, 17582, 30232, 23674, 37522, 29426, 49832
Offset: 0
The a(1) = 1 through a(6) = 19 compositions:
(1) (2) (3) (4) (5) (6)
(1,1) (1,2) (1,3) (1,4) (1,5)
(2,1) (2,2) (2,3) (2,4)
(1,1,1) (3,1) (3,2) (3,3)
(1,1,1,1) (4,1) (4,2)
(1,1,3) (5,1)
(1,2,2) (1,1,4)
(2,2,1) (2,2,2)
(3,1,1) (4,1,1)
(1,1,1,1,1) (1,1,1,1,1,1)
These compositions are ranked by
A334967.
Compositions where every restriction to a subinterval has a different sum are counted by
A169942 and
A325677 and ranked by
A333222. The case of partitions is counted by
A325768 and ranked by
A325779.
Positive subset-sums of partitions are counted by
A276024 and
A299701.
Knapsack compositions are counted by
A325676 and
A325687 and ranked by
A333223. The case of partitions is counted by
A325769 and ranked by
A325778, for which the number of distinct consecutive subsequences is given by
A325770.
-
b:= proc(n, s) option remember; `if`(n=0, 1, add((h->
`if`(nops(h)=nops(map(l-> add(i, i=l), h)),
b(n-j, h), 0))({s[], map(l-> [l[], j], s)[]}), j=1..n))
end:
a:= n-> b(n, {[]}):
seq(a(n), n=0..23); # Alois P. Heinz, Jun 03 2020
-
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],UnsameQ@@Total/@Union[Subsets[#]]&]],{n,0,15}]
Showing 1-8 of 8 results.
Comments