A367220
Number of strict integer partitions of n whose length (number of parts) can be written as a nonnegative linear combination of the parts.
Original entry on oeis.org
1, 1, 0, 1, 1, 2, 3, 3, 4, 5, 7, 7, 10, 11, 15, 17, 22, 25, 32, 37, 46, 53, 65, 75, 90, 105, 124, 143, 168, 193, 224, 258, 297, 340, 390, 446, 509, 580, 660, 751, 852, 967, 1095, 1240, 1401, 1584, 1786, 2015, 2269, 2554, 2869, 3226, 3617, 4056, 4541, 5084
Offset: 0
The a(3) = 1 through a(10) = 7 strict partitions:
(2,1) (3,1) (3,2) (4,2) (5,2) (6,2) (7,2) (8,2)
(4,1) (5,1) (6,1) (7,1) (8,1) (9,1)
(3,2,1) (4,2,1) (4,3,1) (4,3,2) (5,3,2)
(5,2,1) (5,3,1) (5,4,1)
(6,2,1) (6,3,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.
Cf.
A008289,
A088314,
A116861,
A124506,
A363225,
A364346,
A364350,
A364916,
A365073,
A365311,
A365312.
-
combs[n_,y_]:=With[{s=Table[{k,i},{k,y}, {i,0,Floor[n/k]}]}, Select[Tuples[s], Total[Times@@@#]==n&]];
Table[Length[Select[IntegerPartitions[n], UnsameQ@@#&&combs[Length[#], Union[#]]!={}&]], {n,0,15}]
A367221
Number of strict integer partitions of n whose length (number of parts) cannot be written as a nonnegative linear combination of the parts.
Original entry on oeis.org
0, 0, 1, 1, 1, 1, 1, 2, 2, 3, 3, 5, 5, 7, 7, 10, 10, 13, 14, 17, 18, 23, 24, 29, 32, 37, 41, 49, 54, 63, 72, 82, 93, 108, 122, 139, 159, 180, 204, 231, 261, 293, 331, 370, 415, 464, 518, 575, 641, 710, 789, 871, 965, 1064, 1177, 1294, 1428, 1569, 1729, 1897
Offset: 0
The a(2) = 1 through a(16) = 10 strict partitions (A..G = 10..16):
2 3 4 5 6 7 8 9 A B C D E F G
43 53 54 64 65 75 76 86 87 97
63 73 74 84 85 95 96 A6
83 93 94 A4 A5 B5
542 642 A3 B3 B4 C4
652 752 C3 D3
742 842 654 754
762 862
852 952
942 A42
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.
A240855 counts strict partitions whose length is a part, complement
A240861.
Triangles:
A046663 counts partitions of n without a subset-sum k, strict
A365663.
A365541 counts subsets containing two distinct elements summing to k.
-
combs[n_,y_]:=With[{s=Table[{k,i},{k,y}, {i,0,Floor[n/k]}]}, Select[Tuples[s], Total[Times@@@#]==n&]];
Table[Length[Select[IntegerPartitions[n], UnsameQ@@#&&combs[Length[#], Union[#]]=={}&]], {n,0,30}]
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
A367223
Number of subsets of {1..n} whose cardinality cannot be written as a nonnegative linear combination of the elements.
Original entry on oeis.org
0, 0, 1, 2, 4, 8, 15, 27, 49, 90, 165, 301, 548, 998, 1819, 3316, 6040, 10986, 19959, 36253, 65904, 119986, 218796, 399461, 729752, 1333162, 2434411, 4441954, 8097478, 14746715, 26830230, 48773790, 88605927, 160900978, 292140427, 530487359, 963610200, 1751171679, 3183997509
Offset: 0
3 cannot be written as a nonnegative linear combination of 2, 4, and 5, so {2,4,5} is counted under a(6).
The a(2) = 1 through a(6) = 15 subsets:
{2} {2} {2} {2} {2}
{3} {3} {3} {3}
{4} {4} {4}
{3,4} {5} {5}
{3,4} {6}
{3,5} {3,4}
{4,5} {3,5}
{2,4,5} {3,6}
{4,5}
{4,6}
{5,6}
{2,4,5}
{2,4,6}
{2,5,6}
{4,5,6}
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:
A116861 counts positive linear combinations of strict partitions of k.
A364916 counts linear combinations of strict partitions of k.
Cf.
A068911,
A088314,
A103580,
A237667,
A326020,
A326080,
A364350,
A365073,
A365312,
A365377,
A365380.
-
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 A367223(n):
c, mlist = 0, []
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:
break
else:
c += 1
return c # Chai Wah Wu, Nov 16 2023
A367227
Numbers m whose prime indices have no nonnegative linear combination equal to bigomega(m).
Original entry on oeis.org
3, 5, 7, 11, 13, 17, 19, 23, 25, 27, 29, 31, 35, 37, 41, 43, 47, 49, 53, 55, 59, 61, 63, 65, 67, 71, 73, 77, 79, 83, 85, 89, 91, 95, 97, 99, 101, 103, 107, 109, 113, 115, 117, 119, 121, 127, 131, 133, 137, 139, 143, 145, 147, 149, 151, 153, 155, 157, 161, 163
Offset: 1
The prime indices of 24 are {1,1,1,2} with (1+1+1+1) = 4 or (1+1)+(2) = 4 or (2+2) = 4, so 24 is not in the sequence.
The terms together with their prime indices begin:
3: {2} 43: {14} 85: {3,7}
5: {3} 47: {15} 89: {24}
7: {4} 49: {4,4} 91: {4,6}
11: {5} 53: {16} 95: {3,8}
13: {6} 55: {3,5} 97: {25}
17: {7} 59: {17} 99: {2,2,5}
19: {8} 61: {18} 101: {26}
23: {9} 63: {2,2,4} 103: {27}
25: {3,3} 65: {3,6} 107: {28}
27: {2,2,2} 67: {19} 109: {29}
29: {10} 71: {20} 113: {30}
31: {11} 73: {21} 115: {3,9}
35: {3,4} 77: {4,5} 117: {2,2,6}
37: {12} 79: {22} 119: {4,7}
41: {13} 83: {23} 121: {5,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
-------------------------------------------
A124506 appears to count combination-free subsets, differences of
A326083.
Cf.
A000720,
A046663,
A088314,
A106529,
A116861,
A236912,
A364345,
A364346,
A364347,
A364350,
A365073,
A365312.
-
prix[n_]:=If[n==1,{}, Flatten[Cases[FactorInteger[n], {p_,k_}:>Table[PrimePi[p], {k}]]]];
combs[n_,y_]:=With[{s=Table[{k,i}, {k,y}, {i,0,Floor[n/k]}]}, Select[Tuples[s], Total[Times@@@#]==n&]];
Select[Range[100], combs[PrimeOmega[#], Union[prix[#]]]=={}&]
A365376
Number of subsets of {1..n} with a subset summing to n.
Original entry on oeis.org
1, 1, 2, 5, 10, 23, 47, 102, 207, 440, 890, 1847, 3730, 7648, 15400, 31332, 62922, 127234, 255374, 514269, 1030809, 2071344, 4148707, 8321937, 16660755, 33384685, 66812942, 133789638, 267685113, 535784667, 1071878216, 2144762139, 4290261840, 8583175092, 17168208940, 34342860713
Offset: 0
The a(1) = 1 through a(4) = 10 sets:
{1} {2} {3} {4}
{1,2} {1,2} {1,3}
{1,3} {1,4}
{2,3} {2,4}
{1,2,3} {3,4}
{1,2,3}
{1,2,4}
{1,3,4}
{2,3,4}
{1,2,3,4}
The case containing n is counted by
A131577.
The version with re-usable parts is
A365073.
The complement is counted by
A365377.
The complement w/ re-usable parts is
A365380.
A000124 counts distinct possible sums of subsets of {1..n}.
A124506 appears to count combination-free subsets, differences of
A326083.
A364350 counts combination-free strict partitions, complement
A364839.
-
Table[Length[Select[Subsets[Range[n]],MemberQ[Total/@Subsets[#],n]&]],{n,0,10}]
-
isok(s, n) = forsubset(#s, ss, if (vecsum(vector(#ss, k, s[ss[k]])) == n, return(1)));
a(n) = my(nb=0); forsubset(n, s, if (isok(s, n), nb++)); nb; \\ Michel Marcus, Sep 09 2023
-
from itertools import combinations, chain
from sympy.utilities.iterables import partitions
def A365376(n):
if n == 0: return 1
nset = set(range(1,n+1))
s, c = [set(p) for p in partitions(n,m=n,k=n) if max(p.values(),default=1) == 1], 1
for a in chain.from_iterable(combinations(nset,m) for m in range(2,n+1)):
if sum(a) >= n:
aset = set(a)
for p in s:
if p.issubset(aset):
c += 1
break
return c # Chai Wah Wu, Sep 09 2023
A366320
Irregular triangle read by rows where T(n,k) is the number of subsets of {1..n} without a subset summing to k.
Original entry on oeis.org
1, 2, 2, 3, 4, 4, 3, 6, 6, 7, 8, 8, 6, 6, 9, 11, 11, 14, 14, 15, 16, 16, 12, 12, 9, 17, 17, 20, 20, 24, 27, 27, 30, 30, 31, 32, 32, 24, 24, 18, 17, 26, 31, 29, 35, 36, 43, 47, 50, 51, 56, 59, 59, 62, 62, 63
Offset: 1
Triangle begins:
1
2 2 3
4 4 3 6 6 7
8 8 6 6 9 11 11 14 14 15
16 16 12 12 9 17 17 20 20 24 27 27 30 30 31
32 32 24 24 18 17 26 31 29 35 36 43 47 50 51 56 59 59 62 62 63
Row n = 3 counts the following subsets:
{} {} {} {} {} {}
{2} {1} {1} {1} {1} {1}
{3} {3} {2} {2} {2} {2}
{2,3} {1,3} {3} {3} {3}
{1,2} {1,2} {1,2}
{2,3} {1,3} {1,3}
{2,3}
The complement is counted by
A365381.
A000009 counts subsets summing to n.
A000124 counts distinct possible sums of subsets of {1..n}.
-
Table[Length[Select[Subsets[Range[n]],FreeQ[Total/@Subsets[#],k]&]],{n,8},{k,n*(n+1)/2}]
A365043
Number of subsets of {1..n} whose greatest element can be written as a (strictly) positive linear combination of the others.
Original entry on oeis.org
0, 0, 1, 3, 7, 12, 21, 32, 49, 70, 99, 135, 185, 245, 323, 418, 541, 688, 873, 1094, 1368, 1693, 2092, 2564, 3138, 3810, 4620, 5565, 6696, 8012, 9569, 11381, 13518, 15980, 18872, 22194, 26075, 30535, 35711, 41627, 48473, 56290, 65283, 75533, 87298, 100631, 115911, 133219
Offset: 0
The subset S = {3,4,9} has 9 = 3*3 + 0*4, but this is not strictly positive, so S is not counted under a(9).
The subset S = {3,4,10} has 10 = 2*3 + 1*4, so S is counted under a(10).
The a(0) = 0 through a(5) = 12 subsets:
. . {1,2} {1,2} {1,2} {1,2}
{1,3} {1,3} {1,3}
{1,2,3} {1,4} {1,4}
{2,4} {1,5}
{1,2,3} {2,4}
{1,2,4} {1,2,3}
{1,3,4} {1,2,4}
{1,2,5}
{1,3,4}
{1,3,5}
{1,4,5}
{2,3,5}
A085489 and
A364755 count subsets with no sum of two distinct elements.
A088809 and
A364756 count subsets with some sum of two distinct elements.
A364350 counts combination-free strict partitions, complement
A364839.
A364913 counts combination-full partitions.
-
combp[n_,y_]:=With[{s=Table[{k,i},{k,y},{i,1,Floor[n/k]}]},Select[Tuples[s],Total[Times@@@#]==n&]];
Table[Length[Select[Rest[Subsets[Range[n]]],combp[Last[#],Union[Most[#]]]!={}&]],{n,0,10}]
-
from itertools import combinations
from sympy.utilities.iterables import partitions
def A365043(n):
mlist = tuple({tuple(sorted(p.keys())) for p in partitions(m,k=m-1)} for m in range(1,n+1))
return sum(1 for k in range(2,n+1) for w in combinations(range(1,n+1),k) if w[:-1] in mlist[w[-1]-1]) # Chai Wah Wu, Nov 20 2023
A365377
Number of subsets of {1..n} without a subset summing to n.
Original entry on oeis.org
0, 1, 2, 3, 6, 9, 17, 26, 49, 72, 134, 201, 366, 544, 984, 1436, 2614, 3838, 6770, 10019, 17767, 25808, 45597, 66671, 116461, 169747, 295922, 428090, 750343, 1086245, 1863608, 2721509, 4705456, 6759500, 11660244, 16877655, 28879255, 41778027, 71384579, 102527811, 176151979
Offset: 0
The a(1) = 1 through a(6) = 17 subsets:
{} {} {} {} {} {}
{1} {1} {1} {1} {1}
{2} {2} {2} {2}
{3} {3} {3}
{1,2} {4} {4}
{2,3} {1,2} {5}
{1,3} {1,2}
{2,4} {1,3}
{3,4} {1,4}
{2,3}
{2,5}
{3,4}
{3,5}
{4,5}
{1,3,4}
{2,3,5}
{3,4,5}
The complement w/ re-usable parts is
A365073.
The complement is counted by
A365376.
The version with re-usable parts is
A365380.
A000124 counts distinct possible sums of subsets of {1..n}.
A124506 appears to count combination-free subsets, differences of
A326083.
A364350 counts combination-free strict partitions, complement
A364839.
A365381 counts subsets of {1..n} with a subset summing to k.
Cf.
A007865,
A085489,
A088809,
A093971,
A103580,
A151897,
A236912,
A237113,
A237668,
A326080,
A364349,
A364534.
-
Table[Length[Select[Subsets[Range[n]], FreeQ[Total/@Subsets[#],n]&]],{n,0,10}]
-
isok(s, n) = forsubset(#s, ss, if (vecsum(vector(#ss, k, s[ss[k]])) == n, return(0))); return(1);
a(n) = my(nb=0); forsubset(n, s, if (isok(s, n), nb++)); nb; \\ Michel Marcus, Sep 09 2023
-
from itertools import combinations, chain
from sympy.utilities.iterables import partitions
def A365377(n):
if n == 0: return 0
nset = set(range(1,n+1))
s, c = [set(p) for p in partitions(n,m=n,k=n) if max(p.values(),default=1) == 1], 1
for a in chain.from_iterable(combinations(nset,m) for m in range(2,n+1)):
if sum(a) >= n:
aset = set(a)
for p in s:
if p.issubset(aset):
c += 1
break
return (1<Chai Wah Wu, Sep 09 2023
A365320
Number of pairs of distinct positive integers <= n that cannot be linearly combined with nonnegative coefficients to obtain n.
Original entry on oeis.org
0, 0, 0, 0, 0, 2, 1, 7, 5, 12, 12, 27, 14, 42, 36, 47, 47, 83, 58, 109, 80, 116, 126, 172, 111, 195, 192, 219, 202, 294, 210, 342, 286, 354, 369, 409, 324, 509, 480, 523, 452, 640, 507, 711, 622, 675, 747, 865, 654, 916, 842, 964, 922, 1124, 940, 1147, 1029
Offset: 0
The pair p = (3,6) cannot be linearly combined to obtain 8 or 10, so p is counted under a(8) and a(10), but we have 9 = 1*3 + 1*6 or 9 = 3*3 + 0*6, so p not counted under a(9).
The a(5) = 2 through a(10) = 12 pairs:
(2,4) (4,5) (2,4) (3,6) (2,4) (3,6)
(3,4) (2,6) (3,7) (2,6) (3,8)
(3,5) (5,6) (2,8) (3,9)
(3,6) (5,7) (4,6) (4,7)
(4,5) (6,7) (4,7) (4,8)
(4,6) (4,8) (4,9)
(5,6) (5,6) (6,7)
(5,7) (6,8)
(5,8) (6,9)
(6,7) (7,8)
(6,8) (7,9)
(7,8) (8,9)
The case of positive coefficients is
A365321, for all subsets
A365322.
For all subsets instead of just pairs we have
A365380, complement
A365073.
A004526 counts partitions of length 2, shift right for strict.
A364350 counts combination-free strict partitions.
-
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],{2}],combs[n,#]=={}&]],{n,0,30}]
-
from itertools import count
from sympy import divisors
def A365320(n):
a = set()
for i in range(1,n+1):
if not n%i:
a.update(tuple(sorted((i,j))) for j in range(1,n+1) if j!=i)
else:
for j in count(0,i):
if j > n:
break
k = n-j
for d in divisors(k):
if d>=i:
break
a.add((d,i))
return (n*(n-1)>>1)-len(a) # Chai Wah Wu, Sep 13 2023
Comments