A364914
Number of subsets of {1..n} such that some element can be written as a nonnegative linear combination of the others.
Original entry on oeis.org
0, 0, 1, 3, 9, 20, 48, 101, 219, 454, 944, 1917, 3925, 7915, 16004, 32188, 64751, 129822, 260489, 521672, 1045060, 2091808, 4187047, 8377255, 16762285, 33531228, 67077485, 134170217, 268371678, 536772231, 1073611321, 2147282291, 4294697258, 8589527163, 17179321094
Offset: 0
The set {3,4,5,17} has 17 = 1*3 + 1*4 + 2*5, so is counted under a(17).
The a(0) = 0 through a(5) = 20 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}
{2,3,4} {1,2,5}
{1,2,3,4} {1,3,4}
{1,3,5}
{1,4,5}
{2,3,4}
{2,3,5}
{2,4,5}
{1,2,3,4}
{1,2,3,5}
{1,2,4,5}
{1,3,4,5}
{2,3,4,5}
{1,2,3,4,5}
The binary version without re-usable parts is
A088809.
The complement without re-usable parts is
A151897.
The complement is counted by
A326083.
The version without re-usable parts is
A364534.
The version for partitions is
A364913.
Cf.
A011782,
A085489,
A103580,
A116861,
A124506,
A237113,
A237668,
A308546,
A324736,
A326020,
A326080,
A364272,
A364349,
A364756.
-
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]],Or@@Table[combs[#[[k]],Delete[#,k]]!={},{k,Length[#]}]&]],{n,0,10}]
-
from itertools import combinations
from sympy.utilities.iterables import partitions
def A364914(n):
c, mlist = 0, []
for m in range(1,n+1):
t = set()
for p in partitions(m,k=m-1):
t.add(tuple(sorted(p.keys())))
mlist.append([set(d) for d in t])
for k in range(2,n+1):
for w in combinations(range(1,n+1),k):
ws = set(w)
for d in w:
for s in mlist[d-1]:
if s <= ws:
c += 1
break
else:
continue
break
return c # Chai Wah Wu, Nov 17 2023
A365046
Number of subsets of {1..n} containing n such that some element can be written as a nonnegative linear combination of the others.
Original entry on oeis.org
0, 0, 1, 2, 6, 11, 28, 53, 118, 235, 490, 973, 2008, 3990, 8089, 16184, 32563, 65071, 130667, 261183, 523388, 1046748, 2095239, 4190208, 8385030, 16768943, 33546257, 67092732, 134201461, 268400553, 536839090, 1073670970, 2147414967, 4294829905, 8589793931
Offset: 0
The subset {3,4,10} has 10 = 2*3 + 1*4 so is counted under a(10).
The a(0) = 0 through a(5) = 11 subsets:
. . {1,2} {1,3} {1,4} {1,5}
{1,2,3} {2,4} {1,2,5}
{1,2,4} {1,3,5}
{1,3,4} {1,4,5}
{2,3,4} {2,3,5}
{1,2,3,4} {2,4,5}
{1,2,3,5}
{1,2,4,5}
{1,3,4,5}
{2,3,4,5}
{1,2,3,4,5}
The positive complement is counted by
A365045, first differences of
A365044.
Without re-usable parts we have
A365069, first differences of
A364534.
A364350 counts combination-free strict partitions, complement
A364839.
A085489 and
A364755 count subsets without the sum of two distinct elements.
A088809 and
A364756 count subsets with the sum of two distinct elements.
A364913 counts combination-full 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]],MemberQ[#,n]&&Or@@Table[combs[#[[k]],Union[Delete[#,k]]]!={},{k,Length[#]}]&]],{n,0,10}]
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
A365045
Number of subsets of {1..n} containing n such that no element can be written as a positive linear combination of the others.
Original entry on oeis.org
0, 1, 1, 2, 4, 11, 23, 53, 111, 235, 483, 988, 1998, 4036, 8114, 16289, 32645, 65389, 130887, 261923, 524014, 1048251, 2096753, 4193832, 8388034, 16776544, 33553622, 67107919, 134216597, 268434140, 536869355, 1073740012, 2147481511, 4294964834, 8589931700
Offset: 0
The subset {3,4,10} has 10 = 2*3 + 1*4 so is not counted under a(10).
The a(0) = 0 through a(5) = 11 subsets:
. {1} {2} {3} {4} {5}
{2,3} {3,4} {2,5}
{2,3,4} {3,5}
{1,2,3,4} {4,5}
{2,4,5}
{3,4,5}
{1,2,3,5}
{1,2,4,5}
{1,3,4,5}
{2,3,4,5}
{1,2,3,4,5}
Without re-usable parts we have
A365071, first differences of
A151897.
A085489 and
A364755 count subsets w/o the sum of two distinct elements.
A088809 and
A364756 count subsets with the 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[Subsets[Range[n]],MemberQ[#,n]&&And@@Table[combp[#[[k]],Union[Delete[#,k]]]=={},{k,Length[#]}]&]],{n,0,10}]
A070880
Consider the 2^(n-1)-1 nonempty subsets S of {1, 2, ..., n-1}; a(n) gives number of such S for which it is impossible to partition n into parts from S such that each s in S is used at least once.
Original entry on oeis.org
0, 0, 1, 3, 10, 22, 52, 110, 234, 482, 987, 1997, 4035, 8113, 16288, 32644, 65388, 130886, 261922, 524013, 1048250, 2096752, 4193831, 8388033, 16776543, 33553621, 67107918, 134216596, 268434139, 536869354, 1073740011, 2147481510, 4294964833, 8589931699
Offset: 1
a(4)=3 because there are three different subsets S of {1,2,3} satisfying the condition: {3}, {2,3} & {1,2,3}. For the other subsets S, such as {1,2}, there is a partition of 4 which uses them all (such as 4 = 1+1+2).
From _Gus Wiseman_, Sep 10 2023: (Start)
The a(6) = 22 subsets:
{4} {2,3} {1,2,4} {1,2,3,4} {1,2,3,4,5}
{5} {2,5} {1,2,5} {1,2,3,5}
{3,4} {1,3,4} {1,2,4,5}
{3,5} {1,3,5} {1,3,4,5}
{4,5} {1,4,5} {2,3,4,5}
{2,3,4}
{2,3,5}
{2,4,5}
{3,4,5}
(End)
For sets with sum < n instead of maximum < n we have
A088528.
Allowing empty sets gives
A365045, nonnegative version apparently
A124506.
Without re-usable parts we have
A365377(n) - 1.
For nonnegative (instead of positive) coefficients we have
A365380(n) - 1.
A364350 counts combination-free strict partitions, complement
A364913.
-
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-1]]], combp[n,#]=={}&]],{n,7}] (* Gus Wiseman, Sep 10 2023 *)
-
from sympy.utilities.iterables import partitions
def A070880(n): return (1<Chai Wah Wu, Sep 10 2023
A365006
Number of strict integer partitions of n such that no part can be written as a (strictly) positive linear combination of the others.
Original entry on oeis.org
1, 1, 1, 1, 1, 2, 1, 3, 2, 4, 4, 8, 4, 11, 9, 16, 14, 25, 20, 37, 31, 49, 47, 73, 64, 101, 96, 135, 133, 190, 181, 256, 253, 336, 342, 453, 452, 596, 609, 771, 803, 1014, 1041, 1309, 1362, 1674, 1760, 2151, 2249, 2736, 2884, 3449, 3661, 4366, 4615, 5486, 5825
Offset: 0
The a(8) = 2 through a(13) = 11 partitions:
(8) (9) (10) (11) (12) (13)
(5,3) (5,4) (6,4) (6,5) (7,5) (7,6)
(7,2) (7,3) (7,4) (5,4,3) (8,5)
(4,3,2) (4,3,2,1) (8,3) (5,4,2,1) (9,4)
(9,2) (10,3)
(5,4,2) (11,2)
(6,3,2) (6,4,3)
(5,3,2,1) (6,5,2)
(7,4,2)
(5,4,3,1)
(6,4,2,1)
The nonnegative version for subsets appears to be
A124506.
For subsets instead of partitions we have
A365044, complement
A365043.
A364912 counts linear combinations of partitions of k.
-
combp[n_,y_]:=With[{s=Table[{k,i},{k,y},{i,1,Floor[n/k]}]},Select[Tuples[s],Total[Times@@@#]==n&]];
Table[Length[Select[IntegerPartitions[n],UnsameQ@@#&&And@@Table[combp[#[[k]],Delete[#,k]]=={},{k,Length[#]}]&]],{n,0,30}]
-
from sympy.utilities.iterables import partitions
def A365006(n):
if n <= 1: return 1
alist = [set(tuple(sorted(set(p))) for p in partitions(i)) for i in range(n)]
c = 1
for p in partitions(n,k=n-1):
if max(p.values()) == 1:
s = set(p)
for q in s:
if tuple(sorted(s-{q})) in alist[q]:
break
else:
c += 1
return c # Chai Wah Wu, Sep 20 2023
A365042
Number of subsets of {1..n} containing n such that some element can be written as a positive linear combination of the others.
Original entry on oeis.org
0, 0, 1, 2, 4, 5, 9, 11, 17, 21, 29, 36, 50, 60, 78, 95, 123, 147, 185, 221, 274, 325, 399, 472, 574, 672, 810, 945, 1131, 1316, 1557, 1812, 2137, 2462, 2892, 3322, 3881, 4460, 5176, 5916, 6846, 7817, 8993, 10250, 11765, 13333, 15280, 17308, 19731, 22306
Offset: 0
The subset {3,4,10} has 10 = 2*3 + 1*4 so is counted under a(10).
The a(0) = 0 through a(7) = 11 subsets:
. . {1,2} {1,3} {1,4} {1,5} {1,6} {1,7}
{1,2,3} {2,4} {1,2,5} {2,6} {1,2,7}
{1,2,4} {1,3,5} {3,6} {1,3,7}
{1,3,4} {1,4,5} {1,2,6} {1,4,7}
{2,3,5} {1,3,6} {1,5,7}
{1,4,6} {1,6,7}
{1,5,6} {2,3,7}
{2,4,6} {2,5,7}
{1,2,3,6} {3,4,7}
{1,2,3,7}
{1,2,4,7}
Without re-usable parts we have
A365069, first differences of
A364534.
A085489 and
A364755 count subsets with no sum of two distinct elements.
A088314 counts sets that can be linearly combined to obtain n.
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[Subsets[Range[n]],MemberQ[#,n]&&Or@@Table[combp[#[[k]],Union[Delete[#,k]]]!={},{k,Length[#]}]&]],{n,0,10}]
A365072
Number of integer partitions of n such that no distinct part can be written as a (strictly) positive linear combination of the other distinct parts.
Original entry on oeis.org
1, 1, 2, 2, 3, 3, 4, 5, 6, 8, 9, 17, 15, 31, 34, 53, 65, 109, 117, 196, 224, 328, 405, 586, 673, 968, 1163, 1555, 1889, 2531, 2986, 3969, 4744, 6073, 7333, 9317, 11053, 14011, 16710, 20702, 24714, 30549, 36127, 44413, 52561, 63786, 75583, 91377, 107436, 129463
Offset: 0
The a(1) = 1 through a(8) = 6 partitions:
(1) (2) (3) (4) (5) (6) (7) (8)
(11) (111) (22) (32) (33) (43) (44)
(1111) (11111) (222) (52) (53)
(111111) (322) (332)
(1111111) (2222)
(11111111)
The a(11) = 17 partitions:
(11) (9,2) (7,2,2) (5,3,2,1) (4,3,2,1,1) (1,1,1,1,1,1,1,1,1,1,1)
(8,3) (6,3,2) (5,2,2,2) (3,2,2,2,2)
(7,4) (5,4,2) (4,3,2,2)
(6,5) (5,3,3) (3,3,3,2)
(4,4,3)
For subsets instead of partitions we have
A365044, complement
A365043.
A364912 counts positive linear combinations of 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[Union/@IntegerPartitions[n], Function[ptn,!Or@@Table[combp[ptn[[k]],Delete[ptn,k]]!={}, {k,Length[ptn]}]]@*Union]],{n,0,15}]
-
from sympy.utilities.iterables import partitions
def A365072(n):
if n <= 1: return 1
alist = [set(tuple(sorted(set(p))) for p in partitions(i)) for i in range(n)]
c = 1
for p in partitions(n,k=n-1):
s = set(p)
for q in s:
if tuple(sorted(s-{q})) in alist[q]:
break
else:
c += 1
return c # Chai Wah Wu, Sep 20 2023
Showing 1-8 of 8 results.
Comments