A365541
Irregular triangle read by rows where T(n,k) is the number of subsets of {1..n} containing two distinct elements summing to k = 3..2n-1.
Original entry on oeis.org
1, 2, 2, 2, 4, 4, 7, 4, 4, 8, 8, 14, 14, 14, 8, 8, 16, 16, 28, 28, 37, 28, 28, 16, 16, 32, 32, 56, 56, 74, 74, 74, 56, 56, 32, 32, 64, 64, 112, 112, 148, 148, 175, 148, 148, 112, 112, 64, 64, 128, 128, 224, 224, 296, 296, 350, 350, 350, 296, 296, 224, 224, 128, 128
Offset: 2
Triangle begins:
1
2 2 2
4 4 7 4 4
8 8 14 14 14 8 8
16 16 28 28 37 28 28 16 16
32 32 56 56 74 74 74 56 56 32 32
Row n = 4 counts the following subsets:
{1,2} {1,3} {1,4} {2,4} {3,4}
{1,2,3} {1,2,3} {2,3} {1,2,4} {1,3,4}
{1,2,4} {1,3,4} {1,2,3} {2,3,4} {2,3,4}
{1,2,3,4} {1,2,3,4} {1,2,4} {1,2,3,4} {1,2,3,4}
{1,3,4}
{2,3,4}
{1,2,3,4}
The case counting only length-2 subsets is
A008967.
Column k = n + 1 appears to be
A167762.
The version for all subsets (instead of just pairs) is
A365381.
A000009 counts subsets summing to n.
A046663 counts partitions with no submultiset summing to k, strict
A365663.
A365543 counts partitions with a submultiset summing to k, strict
A365661.
-
Table[Length[Select[Subsets[Range[n]], MemberQ[Total/@Subsets[#,{2}],k]&]], {n,2,11}, {k,3,2n-1}]
A364347
Numbers k > 0 such that if prime(a) and prime(b) both divide k, then prime(a+b) does not.
Original entry on oeis.org
1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 19, 20, 22, 23, 25, 26, 27, 28, 29, 31, 32, 33, 34, 35, 37, 38, 39, 40, 41, 43, 44, 45, 46, 47, 49, 50, 51, 52, 53, 55, 56, 57, 58, 59, 61, 62, 64, 67, 68, 69, 71, 73, 74, 75, 76, 77, 79, 80, 81, 82, 83, 85
Offset: 1
We don't have 6 because prime(1), prime(1), and prime(1+1) are all divisors.
The terms together with their prime indices begin:
1: {}
2: {1}
3: {2}
4: {1,1}
5: {3}
7: {4}
8: {1,1,1}
9: {2,2}
10: {1,3}
11: {5}
13: {6}
14: {1,4}
15: {2,3}
16: {1,1,1,1}
17: {7}
19: {8}
20: {1,1,3}
Subsets of this type are counted by
A007865 (sum-free sets).
Partitions of this type are counted by
A364345.
The squarefree case is counted by
A364346.
The non-binary version is counted by
A364350.
Without re-using parts we have complement
A364462, counted by
A237113.
-
prix[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
Select[Range[100],Intersection[prix[#],Total/@Tuples[prix[#],2]]=={}&]
A288728
Number of sum-free sets that can be created by adding n to all sum-free sets [1..n-1].
Original entry on oeis.org
1, 1, 3, 3, 7, 8, 18, 19, 47, 43, 102, 116, 238, 240, 553, 554, 1185, 1259, 2578, 2607, 5873, 5526, 11834, 12601, 24692, 24390, 53735, 52534, 107445, 107330, 218727, 215607, 461367, 427778, 891039, 910294, 1804606, 1706828, 3695418, 3411513, 7136850, 6892950
Offset: 1
1 can be added to {};
2 can be added to {} but not {1};
3 can be added to {},{1},{2};
4 can be added to {},{1},{3} but not {2},{1,3},{2,3}.
From _Gus Wiseman_, Aug 12 2023: (Start)
The a(1) = 1 through a(7) = 18 sum-free sets with maximum n:
{1} {2} {3} {4} {5} {6} {7}
{1,3} {1,4} {1,5} {1,6} {1,7}
{2,3} {3,4} {2,5} {2,6} {2,7}
{3,5} {4,6} {3,7}
{4,5} {5,6} {4,7}
{1,3,5} {1,4,6} {5,7}
{3,4,5} {2,5,6} {6,7}
{4,5,6} {1,3,7}
{1,4,7}
{1,5,7}
{2,3,7}
{2,6,7}
{3,5,7}
{4,5,7}
{4,6,7}
{5,6,7}
{1,3,5,7}
{4,5,6,7}
(End)
For non-binary sum-free subsets of {1..n} we have
A237667.
For sum-free partitions we have
A364345, without re-using parts
A236912.
The complement without re-using parts is
A364756, differences of
A088809.
-
Table[Length[Select[Subsets[Range[n]],MemberQ[#,n]&&Intersection[#,Total/@Tuples[#,2]]=={}&]],{n,10}] (* Gus Wiseman, Aug 12 2023 *)
A363226
Number of strict integer partitions of n containing some three possibly equal parts (a,b,c) such that a + b = c. A variation of sum-full strict partitions.
Original entry on oeis.org
0, 0, 0, 1, 0, 0, 2, 1, 2, 3, 5, 4, 6, 7, 11, 11, 16, 18, 26, 29, 34, 42, 51, 62, 72, 84, 101, 119, 142, 166, 191, 226, 262, 300, 354, 405, 467, 540, 623, 705, 807, 927, 1060, 1206, 1369, 1551, 1760, 1998, 2248, 2556, 2861, 3236, 3628, 4100, 4587, 5152, 5756
Offset: 0
The a(3) = 1 through a(15) = 11 partitions (A=10, B=11, C=12):
21 . . 42 421 431 63 532 542 84 643 653 A5
321 521 432 541 632 642 742 743 843
621 631 821 651 841 752 942
721 5321 921 A21 761 C21
4321 5421 5431 842 6432
6321 6421 B21 6531
7321 5432 7431
6431 7521
6521 8421
7421 9321
8321 54321
For subsets of {1..n} we have
A093971 (sum-full sets), complement
A007865.
A236912 counts sum-free partitions not re-using parts, complement
A237113.
-
Table[Length[Select[IntegerPartitions[n],UnsameQ@@#&&Select[Tuples[#,3],#[[1]]+#[[2]]==#[[3]]&]!={}&]],{n,0,30}]
-
from itertools import combinations_with_replacement
from collections import Counter
from sympy.utilities.iterables import partitions
def A363226(n): return sum(1 for p in partitions(n) if max(p.values(),default=0)==1 and any(q[0]+q[1]==q[2] for q in combinations_with_replacement(sorted(Counter(p).elements()),3))) # Chai Wah Wu, Sep 20 2023
A365380
Number of subsets of {1..n} that cannot be linearly combined using nonnegative coefficients to obtain n.
Original entry on oeis.org
1, 1, 2, 2, 6, 4, 16, 12, 32, 32, 104, 48, 256, 208, 448, 448, 1568, 896, 3840, 2368, 6912, 7680, 22912, 10752, 50688, 44800, 104448, 88064, 324096, 165888, 780288, 541696, 1458176, 1519616, 4044800, 2220032, 10838016, 8744960, 20250624, 16433152, 62267392, 34865152
Offset: 1
The set {4,5,6} cannot be linearly combined to obtain 7 so is counted under a(7), but we have 8 = 2*4 + 0*5 + 0*6, so it is not counted under a(8).
The a(1) = 1 through a(8) = 12 subsets:
{} {} {} {} {} {} {} {}
{2} {3} {2} {4} {2} {3}
{3} {5} {3} {5}
{4} {4,5} {4} {6}
{2,4} {5} {7}
{3,4} {6} {3,6}
{2,4} {3,7}
{2,6} {5,6}
{3,5} {5,7}
{3,6} {6,7}
{4,5} {3,6,7}
{4,6} {5,6,7}
{5,6}
{2,4,6}
{3,5,6}
{4,5,6}
A124506 appears to count combination-free subsets, differences of
A326083.
A365046 counts combination-full subsets, first differences of
A364914.
-
combs[n_,y_]:=With[{s=Table[{k,i},{k,y},{i,0,Floor[n/k]}]},Select[Tuples[s],Total[Times@@@#]==n&]];
Table[Length[Select[Subsets[Range[n-1]],combs[n,#]=={}&]],{n,5}]
A367212
Number of integer partitions of n whose length (number of parts) is equal to the sum of some submultiset.
Original entry on oeis.org
1, 1, 1, 2, 3, 5, 6, 11, 15, 22, 30, 43, 58, 80, 106, 143, 186, 248, 318, 417, 530, 684, 863, 1103, 1379, 1741, 2162, 2707, 3339, 4145, 5081, 6263, 7640, 9357, 11350, 13822, 16692, 20214, 24301, 29300, 35073, 42085, 50208, 59981, 71294, 84866, 100509, 119206
Offset: 0
The partition (3,2,1,1) has submultisets (3,1) or (2,1,1) with sum 4, so is counted under a(7).
The a(1) = 1 through a(8) = 15 partitions:
(1) (11) (21) (22) (32) (42) (52) (62)
(111) (211) (221) (321) (322) (332)
(1111) (311) (2211) (331) (431)
(2111) (3111) (421) (521)
(11111) (21111) (2221) (2222)
(111111) (3211) (3221)
(4111) (3311)
(22111) (4211)
(31111) (22211)
(211111) (32111)
(1111111) (41111)
(221111)
(311111)
(2111111)
(11111111)
The following sequences count and rank integer partitions and finite sets according to whether their length is a subset-sum or linear combination of the parts. The current sequence is starred.
sum-full sum-free comb-full comb-free
-------------------------------------------
Triangles:
-
Table[Length[Select[IntegerPartitions[n], MemberQ[Total/@Subsets[#], Length[#]]&]], {n,0,10}]
A367214
Number of strict integer partitions of n whose length (number of parts) is equal to the sum of some submultiset.
Original entry on oeis.org
1, 1, 0, 1, 0, 1, 2, 2, 3, 4, 5, 5, 7, 8, 10, 12, 14, 17, 21, 25, 30, 36, 43, 51, 60, 71, 83, 97, 113, 132, 153, 178, 205, 238, 272, 315, 360, 413, 471, 539, 613, 698, 792, 899, 1018, 1153, 1302, 1470, 1658, 1867, 2100, 2362, 2652, 2974, 3335, 3734, 4178, 4672
Offset: 0
The strict partition (6,4,3,2,1) has submultisets {1,4} and {2,3} with sum 5 so is counted under a(16).
The a(1) = 1 through a(10) = 5 strict partitions:
(1) . (2,1) . (3,2) (4,2) (5,2) (6,2) (7,2) (8,2)
(3,2,1) (4,2,1) (4,3,1) (4,3,2) (5,3,2)
(5,2,1) (5,3,1) (6,3,1)
(6,2,1) (7,2,1)
(4,3,2,1)
The following sequences count and rank integer partitions and finite sets according to whether their length is a subset-sum or linear combination of the parts. The current sequence is starred.
sum-full sum-free comb-full comb-free
-------------------------------------------
A240855 counts strict partitions whose length is a part, complement
A240861.
Triangles:
A365661 counts strict partitions with a subset-sum k, non-strict
A365543.
Cf.
A002865,
A126796,
A237113,
A237668,
A238628,
A363225,
A364346,
A364350,
A364533,
A365311,
A365922.
-
Table[Length[Select[IntegerPartitions[n], UnsameQ@@#&&MemberQ[Total/@Subsets[#], Length[#]]&]], {n,0,30}]
A367216
Number of subsets of {1..n} whose cardinality is equal to the sum of some subset.
Original entry on oeis.org
1, 2, 3, 5, 10, 20, 40, 82, 169, 348, 716, 1471, 3016, 6171, 12605, 25710, 52370, 106539, 216470, 439310, 890550, 1803415, 3648557, 7375141, 14896184, 30065129, 60639954, 122231740, 246239551, 495790161, 997747182, 2006969629, 4035274292, 8110185100, 16293958314, 32724456982
Offset: 0
The a(0) = 1 through a(4) = 10 subsets:
{} {} {} {} {}
{1} {1} {1} {1}
{1,2} {1,2} {1,2}
{2,3} {2,3}
{1,2,3} {2,4}
{1,2,3}
{1,2,4}
{1,3,4}
{2,3,4}
{1,2,3,4}
The following sequences count and rank integer partitions and finite sets according to whether their length is a subset-sum or linear combination of the parts. The current sequence is starred.
sum-full sum-free comb-full comb-free
-------------------------------------------
A000009 counts subsets summing to n.
A000124 counts distinct possible sums of subsets of {1..n}.
A240855 counts strict partitions whose length is a part, complement
A240861.
Triangles:
A365541 counts sets containing two distinct elements summing to k.
-
Table[Length[Select[Subsets[Range[n]], MemberQ[Total/@Subsets[#], Length[#]]&]], {n,0,10}]
A367217
Number of subsets of {1..n} whose cardinality is not equal to the sum of any subset.
Original entry on oeis.org
0, 0, 1, 3, 6, 12, 24, 46, 87, 164, 308, 577, 1080, 2021, 3779, 7058, 13166, 24533, 45674, 84978, 158026, 293737, 545747, 1013467, 1881032, 3489303, 6468910, 11985988, 22195905, 41080751, 75994642, 140514019, 259693004, 479749492, 885910870, 1635281386
Offset: 0
The a(2) = 1 through a(5) = 12 subsets:
{2} {2} {2} {2}
{3} {3} {3}
{1,3} {4} {4}
{1,3} {5}
{1,4} {1,3}
{3,4} {1,4}
{1,5}
{3,4}
{3,5}
{4,5}
{1,4,5}
{2,4,5}
The following sequences count and rank integer partitions and finite sets according to whether their length is a subset-sum or linear combination of the parts. The current sequence is starred.
sum-full sum-free comb-full comb-free
-------------------------------------------
A000009 counts subsets summing to n.
A000124 counts distinct possible sums of subsets of {1..n}.
A229816 counts partitions whose length is not a part, complement
A002865.
A124506 appears to count combination-free subsets, differences of
A326083.
Triangles:
A046663 counts partitions of n without a subset-sum k, strict
A365663.
A365541 counts sets containing two distinct elements summing to k.
Cf.
A068911,
A103580,
A240861,
A288728,
A326080,
A326083,
A364346,
A364349,
A365046,
A365376,
A365377.
-
Table[Length[Select[Subsets[Range[n]], FreeQ[Total/@Subsets[#], Length[#]]&]], {n,0,15}]
A367222
Number of subsets of {1..n} whose cardinality can be written as a nonnegative linear combination of the elements.
Original entry on oeis.org
1, 2, 3, 6, 12, 24, 49, 101, 207, 422, 859, 1747, 3548, 7194, 14565, 29452, 59496, 120086, 242185, 488035, 982672, 1977166, 3975508, 7989147, 16047464, 32221270, 64674453, 129775774, 260337978, 522124197, 1046911594, 2098709858, 4206361369, 8429033614, 16887728757, 33829251009, 67755866536, 135687781793, 271693909435
Offset: 0
The set {1,2,4} has 3 = (2)+(1) or 3 = (1+1+1) so is counted under a(4).
The a(0) = 1 through a(4) = 12 subsets:
{} {} {} {} {}
{1} {1} {1} {1}
{1,2} {1,2} {1,2}
{1,3} {1,3}
{2,3} {1,4}
{1,2,3} {2,3}
{2,4}
{1,2,3}
{1,2,4}
{1,3,4}
{2,3,4}
{1,2,3,4}
The following sequences count and rank integer partitions and finite sets according to whether their length is a subset-sum or linear combination of the parts. The current sequence is starred.
sum-full sum-free comb-full comb-free
-------------------------------------------
A124506 appears to count combination-free subsets, differences of
A326083.
Triangles:
A365541 counts subsets containing two distinct elements summing to k.
Cf.
A068911,
A088314,
A103580,
A116861,
A326080,
A364350,
A365073,
A365311,
A365376,
A365380,
A365544.
-
combs[n_,y_]:=With[{s=Table[{k,i},{k,y}, {i,0,Floor[n/k]}]}, Select[Tuples[s], Total[Times@@@#]==n&]];
Table[Length[Select[Subsets[Range[n]], combs[Length[#], Union[#]]!={}&]], {n,0,10}]
-
from itertools import combinations
from sympy.utilities.iterables import partitions
def A367222(n):
c, mlist = 1, []
for m in range(1,n+1):
t = set()
for p in partitions(m):
t.add(tuple(sorted(p.keys())))
mlist.append([set(d) for d in t])
for k in range(1,n+1):
for w in combinations(range(1,n+1),k):
ws = set(w)
for s in mlist[k-1]:
if s <= ws:
c += 1
break
return c # Chai Wah Wu, Nov 16 2023
Comments