A365073
Number of subsets of {1..n} that can be linearly combined using nonnegative coefficients to obtain n.
Original entry on oeis.org
1, 1, 3, 6, 14, 26, 60, 112, 244, 480, 992, 1944, 4048, 7936, 16176, 32320, 65088, 129504, 261248, 520448, 1046208, 2090240, 4186624, 8365696, 16766464, 33503744, 67064064, 134113280, 268347392, 536546816, 1073575936, 2146703360, 4294425600, 8588476416, 17178349568
Offset: 0
The subset {2,3,6} has 7 = 2*2 + 1*3 + 0*6 so is counted under a(7).
The a(1) = 1 through a(4) = 14 subsets:
{1} {1} {1} {1}
{2} {3} {2}
{1,2} {1,2} {4}
{1,3} {1,2}
{2,3} {1,3}
{1,2,3} {1,4}
{2,3}
{2,4}
{3,4}
{1,2,3}
{1,2,4}
{1,3,4}
{2,3,4}
{1,2,3,4}
The case of positive coefficients is
A088314.
The case of subsets containing n is
A131577.
The positive complement is counted by
A365322.
The complement is counted by
A365380.
The case of subsets without n is
A365542.
A364350 counts combination-free strict partitions.
Cf.
A007865,
A088809,
A093971,
A151897,
A237668,
A308546,
A326020,
A364534,
A364839,
A365043,
A365381.
-
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[n,#]!={}&]],{n,0,5}]
-
a(n)={
my(comb(k,b)=while(b>>k, b=bitor(b, b>>k); k*=2); b);
my(recurse(k,b)=
if(bittest(b,0), 2^(n+1-k),
if(2*k>n, 2^(n+1-k) - 2^sum(j=k, n, !bittest(b,j)),
self()(k+1, b) + self()(k+1, comb(k,b)) )));
recurse(1, 1<Andrew Howroyd, Sep 04 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}]
A365322
Number of subsets of {1..n} that cannot be linearly combined using positive coefficients to obtain n.
Original entry on oeis.org
0, 1, 2, 5, 11, 26, 54, 116, 238, 490, 994, 2011, 4045, 8131, 16305, 32672, 65412, 130924, 261958, 524066, 1048301, 2096826, 4193904, 8388135, 16776641, 33553759, 67108053, 134216782, 268434324, 536869595, 1073740266, 2147481835, 4294965158, 8589932129
Offset: 0
The set {1,3} has 4 = 1 + 3 so is not counted under a(4). However, 3 cannot be written as a linear combination of {1,3} using all positive coefficients, so it is counted under a(3).
The a(1) = 1 through a(4) = 11 subsets:
{} {} {} {}
{1,2} {2} {3}
{1,3} {1,4}
{2,3} {2,3}
{1,2,3} {2,4}
{3,4}
{1,2,3}
{1,2,4}
{1,3,4}
{2,3,4}
{1,2,3,4}
The complement is counted by
A088314.
The version for strict partitions is
A088528.
For nonnegative coefficients we have
A365380.
A085489 and
A364755 count subsets without the sum of two distinct elements.
A124506 appears to count combination-free subsets, differences of
A326083.
A364350 counts combination-free strict partitions, non-strict
A364915.
A365046 counts combination-full subsets, first differences of
A364914.
-
b:= proc(n, i) option remember; `if`(n=0, {{}}, `if`(i<1, {},
{b(n, i-1)[], seq(map(x->{x[], i}, b(n-i*j, i-1))[], j=1..n/i)}))
end:
a:= n-> 2^n-nops(b(n$2)):
seq(a(n), n=0..33); # Alois P. Heinz, Sep 04 2023
-
cpu[n_,y_]:=With[{s=Table[{k,i},{k,Union[y]},{i,1,Floor[n/k]}]},Select[Tuples[s],Total[Times@@@#]==n&]];
Table[Length[Select[Subsets[Range[n]],cpu[n,#]=={}&]],{n,0,10}]
-
from sympy.utilities.iterables import partitions
def A365322(n): return (1<Chai Wah Wu, Sep 14 2023
A365323
Number of integer partitions with sum < n whose distinct parts cannot be linearly combined using all positive coefficients to obtain n.
Original entry on oeis.org
0, 0, 1, 1, 4, 3, 9, 7, 15, 16, 29, 23, 47, 43, 74, 65, 114, 100, 174, 153, 257, 228, 368, 312, 530, 454, 736, 645, 1025, 902, 1402, 1184, 1909, 1626, 2618, 2184, 3412, 2895, 4551, 3887, 5966, 5055, 7796, 6509, 10244, 8462, 13060, 10881, 16834, 14021, 21471
Offset: 1
The partition y = (3,3,2) has distinct parts {2,3}, and we have 9 = 3*2 + 1*3, so y is not counted under a(9).
The a(3) = 1 through a(10) = 16 partitions:
(2) (3) (2) (4) (2) (3) (2) (3)
(3) (5) (3) (5) (4) (4)
(4) (3,2) (4) (6) (5) (6)
(2,2) (5) (7) (6) (7)
(6) (3,3) (7) (8)
(2,2) (4,3) (8) (9)
(3,3) (5,2) (2,2) (3,3)
(4,2) (4,2) (4,4)
(2,2,2) (4,3) (5,2)
(4,4) (5,3)
(5,3) (5,4)
(6,2) (6,3)
(2,2,2) (7,2)
(4,2,2) (3,3,3)
(2,2,2,2) (4,3,2)
(5,2,2)
For strict partitions we have
A088528, nonnegative coefficients
A365312.
For length-2 subsets we have
A365321 (we use n instead of n-1).
A364350 counts combination-free strict partitions, non-strict
A364915.
A364839 counts combination-full strict partitions, non-strict
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[Join@@IntegerPartitions/@Range[n-1],combp[n,Union[#]]=={}&]],{n,10}]
-
from sympy.utilities.iterables import partitions
def A365323(n):
a = {tuple(sorted(set(p))) for p in partitions(n)}
return sum(1 for k in range(1,n) for d in partitions(k) if tuple(sorted(set(d))) not in a) # Chai Wah Wu, Sep 12 2023
Showing 1-4 of 4 results.
Comments