A371956
Number of non-biquanimous compositions of 2n.
Original entry on oeis.org
0, 1, 3, 9, 23, 63, 146, 364
Offset: 0
The a(1) = 1 through a(3) = 9 compositions:
(2) (4) (6)
(1,3) (1,5)
(3,1) (2,4)
(4,2)
(5,1)
(1,1,4)
(1,4,1)
(2,2,2)
(4,1,1)
The complement is counted by
A064914.
A237258 (aerated) counts biquanimous strict partitions, ranks
A357854.
-
Table[Length[Select[Join@@Permutations/@IntegerPartitions[2n], !MemberQ[Total/@Subsets[#],n]&]],{n,0,5}]
A372119
Numbers k such that the k-th composition in standard order is not biquanimous.
Original entry on oeis.org
1, 2, 4, 5, 6, 7, 8, 9, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 40, 42, 48, 49, 56, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96
Offset: 1
The terms and corresponding compositions begin:
1: (1)
2: (2)
4: (3)
5: (2,1)
6: (1,2)
7: (1,1,1)
8: (4)
9: (3,1)
12: (1,3)
16: (5)
17: (4,1)
18: (3,2)
19: (3,1,1)
20: (2,3)
21: (2,2,1)
22: (2,1,2)
23: (2,1,1,1)
These compositions are counted by
A371956.
A237258 (aerated) counts biquanimous strict partitions, ranks
A357854.
-
stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
Select[Range[0,100],!MemberQ[Total/@Subsets[stc[#]], Total[stc[#]]/2]&]
A372120
Numbers k such that the k-th composition in standard order is biquanimous.
Original entry on oeis.org
0, 3, 10, 11, 13, 14, 15, 36, 37, 38, 39, 41, 43, 44, 45, 46, 47, 50, 51, 52, 53, 54, 55, 57, 58, 59, 60, 61, 62, 63, 136, 137, 138, 139, 140, 141, 142, 143, 145, 147, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 162, 163, 165, 166, 167, 168, 169
Offset: 1
The terms and corresponding compositions begin:
0: ()
3: (1,1)
10: (2,2)
11: (2,1,1)
13: (1,2,1)
14: (1,1,2)
15: (1,1,1,1)
36: (3,3)
37: (3,2,1)
38: (3,1,2)
39: (3,1,1,1)
41: (2,3,1)
43: (2,2,1,1)
44: (2,1,3)
45: (2,1,2,1)
46: (2,1,1,2)
47: (2,1,1,1,1)
50: (1,3,2)
51: (1,3,1,1)
52: (1,2,3)
53: (1,2,2,1)
54: (1,2,1,2)
These compositions are counted by
A064914.
The unordered version (integer partitions) is
A357976, counted by
A002219.
A237258 (aerated) counts biquanimous strict partitions, ranks
A357854.
-
stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
Select[Range[0,100],MemberQ[Total/@Subsets[stc[#]], Total[stc[#]]/2]&]
A372121
Row sums of A371783 and A371954 (k-quanimous partitions).
Original entry on oeis.org
1, 3, 4, 9, 8, 22, 16, 42, 41, 74, 57, 183, 102, 233, 263, 463, 298, 875, 491, 1350, 1172, 1775, 1256, 4273, 2225, 4399, 4584, 8049, 4566, 14913, 6843, 18539, 15831, 22894, 18196, 53323, 21638, 48947, 50281, 94500, 44584, 144976, 63262, 173436, 169361, 202153
Offset: 1
-
hwt[n_]:=Total[Cases[FactorInteger[n],{p_,k_}:>PrimePi[p]*k]];
facs[n_]:=If[n<=1,{{}},Join@@Table[Map[Prepend[#,d]&, Select[facs[n/d],Min@@#>=d&]], {d,Rest[Divisors[n]]}]];
Table[Sum[Length[Select[IntegerPartitions[n], Select[facs[Times@@Prime/@#], Length[#]==k&&SameQ@@hwt/@#&]!={}&]],{k,Divisors[n]}],{n,1,10}]
-
T(n, d) = my(v=partitions(n/d), w=List([])); forvec(s=vector(d, i, [1, #v]), listput(w, vecsort(concat(vector(d, i, v[s[i]])))), 1); #Set(w);
a(n) = sumdiv(n, d, T(n, d)); \\ Jinyuan Wang, Feb 13 2025
A371732
Numbers n such that each binary index k (from row n of A048793) has the same sum of binary indices A029931(k).
Original entry on oeis.org
1, 2, 4, 8, 12, 16, 32, 64, 128, 144, 256, 288, 512, 576, 1024, 2048, 3072, 4096, 8192, 16384, 32768, 32800, 33024, 33056, 65536, 65600, 66048, 66112, 131072, 132096, 133120, 134144, 262144, 266240, 524288, 528384, 786432, 790528, 1048576, 1056768, 2097152
Offset: 1
The terms together with their binary expansions and binary indices begin:
1: 1 ~ {1}
2: 10 ~ {2}
4: 100 ~ {3}
8: 1000 ~ {4}
12: 1100 ~ {3,4}
16: 10000 ~ {5}
32: 100000 ~ {6}
64: 1000000 ~ {7}
128: 10000000 ~ {8}
144: 10010000 ~ {5,8}
256: 100000000 ~ {9}
288: 100100000 ~ {6,9}
512: 1000000000 ~ {10}
576: 1001000000 ~ {7,10}
1024: 10000000000 ~ {11}
2048: 100000000000 ~ {12}
3072: 110000000000 ~ {11,12}
4096: 1000000000000 ~ {13}
8192: 10000000000000 ~ {14}
16384: 100000000000000 ~ {15}
32768: 1000000000000000 ~ {16}
32800: 1000000000100000 ~ {6,16}
For prime instead of binary indices we have
A326534.
A070939 gives length of binary expansion.
A096111 gives product of binary indices.
A326031 gives weight of the set-system with BII-number n.
Cf.
A035470,
A038041,
A237258,
A320324,
A321453,
A321455,
A326518,
A336137,
A371783,
A371791,
A371796.
-
bix[n_]:=Join@@Position[Reverse[IntegerDigits[n,2]],1];
Select[Range[1000],SameQ@@Total/@bix/@bix[#]&]
A387388
a(n) is the maximum number of ways in which any strict partition of 2n can be partitioned into two disjoint subsets of equal sum.
Original entry on oeis.org
0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 4, 4, 4, 4, 7, 6, 6, 6, 6, 11, 11, 10, 10, 10, 19, 18, 18, 18, 17, 35, 33, 32, 32, 31, 31, 62, 60, 58, 57, 57, 55, 56, 108, 105, 103, 101, 100, 100, 99, 195, 191, 187, 184, 182, 181, 180, 361, 352, 344, 340, 336, 333
Offset: 1
a(2) = 0, because strict partitions of 4 are {4} and {3,1}. None of these partitions can be partitioned into two disjoint subsets of equal sum.
a(3) = 1, because strict partitions of 6 are {6}, {5,1}, {4,2} and {3,2,1}. There is one way to partition {3,2,1} into two disjoint subsets of equal sum: {3}={2,1}. For the other partitions, this cannot be done.
a(11) = 2, because among the 89 strict partitions of 22 there is {7, 5, 4, 3, 2, 1}. There are two ways to partition {7, 5, 4, 3, 2, 1} into two disjoint subsets of equal sum: {7,4}={5,3,2,1} and {7,3,1}={5,4,2}. And this cannot be done in three ways for any strict partition of 22.
-
def partitions_distinct(n):
def _build(remaining, max_next):
if remaining == 0:
return [[]]
res = []
for k in range(min(remaining, max_next), 0, -1):
for tail in _build(remaining - k, k - 1):
res.append([k] + tail)
return res
return _build(n, n//2) # The biggest number in the subset can't be bigger than n/2
def count_half_subsets(partition, n):
if n % 2:
return 0
half = n // 2
dp = [0] * (half + 1)
dp[0] = 1
for x in partition:
for s in range(half, x - 1, -1):
dp[s] += dp[s - x]
return int(dp[half]/2) #-> to not count {X}={Y} and {Y}={X} as two different solutions
#---- Generate Sequence -----
sequence = []
max_n=25 #number of terms
for N in range(1, max_n):
parts = partitions_distinct(2*N)
max_sols = 0
for p in parts:
subsets = count_half_subsets(p, 2*N)
if subsets > max_sols:
max_sols = subsets
sequence.append(max_sols)
A387389
a(n) is the smallest positive integer for which there exists a strict partition that can be partitioned into two disjoint subsets with equal sum in n ways.
Original entry on oeis.org
6, 22, 32, 28, 40, 38, 36, 52, 50, 48, 46, 66, 64, 64, 62, 62, 60, 58, 56, 80, 80, 78, 78, 76, 78, 76, 74, 74, 72, 72, 70, 70, 68, 96, 66, 96, 94, 96, 92, 94, 92, 92, 90, 92, 90, 88, 88, 90, 86, 88, 86, 86, 84, 84, 84, 82, 82, 82, 80, 80, 110, 78, 112, 114
Offset: 1
a(1) = 6, because S={3,2,1} is a strict partition of 6 and there is a way to partition S into two disjoint subsets of equal sum: {3}={2,1}. It is not possible to do this for any strict partition of integers smaller than 6.
a(2) = 22, because S={7, 5, 4, 3, 2, 1} is a strict partition of 22 and there are two ways to partition S into two disjoint subsets of equal sum: {7,4}={5,3,2,1} and {7,3,1}={5,4,2}. There are no strict partitions of any smaller number for which this can be done.
a(3) = 32, because S={11, 6, 5, 4, 3, 2, 1} is a strict partition of 32 and there are three ways to partition S into two disjoint subsets of equal sum: {11,5}={6,4,3,2,1}, {11,4,1}={6,5,3,2} and {11,3,2}={6,5,4,1}. There are no strict partitions of any smaller number for which this can be done.
-
def partitions_distinct(n):
def _build(remaining, max_next):
if remaining == 0:
return [[]]
res = []
for k in range(min(remaining, max_next), 0, -1):
for tail in _build(remaining - k, k - 1):
res.append([k] + tail)
return res
return _build(n, n//2) # The biggest number in the subset can't be bigger than n/2
def count_half_subsets(partition, n):
if n % 2:
return 0
half = n // 2
dp = [0] * (half + 1)
dp[0] = 1
for x in partition:
for s in range(half, x - 1, -1):
dp[s] += dp[s - x]
return int(dp[half]/2) #-> to not count {X}={Y} and {Y}={X} as two different solutions
#---- Generate Sequence -----
max_n = 15 #number of terms
sequence = []
for n in range(1, max_n):
p_N_exists = False
N=1
while p_N_exists==False:
partes = partitions_distinct(2*N)
for p in partes:
subsets = count_half_subsets(p, 2*N)
if subsets == n:
sequence.append(2*N)
p_N_exists = True
break
N = N+1
Comments