A371738
Numbers with non-quanimous binary indices. Numbers whose binary indices have only one set partition with all equal block-sums.
Original entry on oeis.org
1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 14, 16, 17, 18, 19, 20, 21, 23, 24, 26, 28, 29, 32, 33, 34, 35, 36, 37, 38, 40, 41, 43, 44, 46, 48, 50, 52, 53, 55, 56, 57, 58, 61, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 77, 78, 79, 80, 81, 83, 84, 86, 88, 89, 91, 92
Offset: 1
The binary indices of 165 are {1,3,6,8}, with qualifying set partitions {{1,8},{3,6}}, and {{1,3,6,8}}, so 165 is not in the sequence.
The terms together with their binary expansions and binary indices begin:
1: 1 ~ {1}
2: 10 ~ {2}
3: 11 ~ {1,2}
4: 100 ~ {3}
5: 101 ~ {1,3}
6: 110 ~ {2,3}
8: 1000 ~ {4}
9: 1001 ~ {1,4}
10: 1010 ~ {2,4}
11: 1011 ~ {1,2,4}
12: 1100 ~ {3,4}
14: 1110 ~ {2,3,4}
16: 10000 ~ {5}
17: 10001 ~ {1,5}
18: 10010 ~ {2,5}
19: 10011 ~ {1,2,5}
20: 10100 ~ {3,5}
21: 10101 ~ {1,3,5}
23: 10111 ~ {1,2,3,5}
Set partitions with all equal block-sums are counted by
A035470.
A070939 gives length of binary expansion.
-
bix[n_]:=Join@@Position[Reverse[IntegerDigits[n,2]],1];
sps[{}]:={{}};sps[set:{i_,_}]:=Join@@Function[s,Prepend[#,s]& /@ sps[Complement[set,s]]]/@Cases[Subsets[set],{i,_}];
Select[Range[100],Length[Select[sps[bix[#]],SameQ@@Total/@#&]]==1&]
A371784
Numbers with quanimous binary indices. Numbers whose binary indices can be partitioned in more than one way into blocks with the same sum.
Original entry on oeis.org
7, 13, 15, 22, 25, 27, 30, 31, 39, 42, 45, 47, 49, 51, 54, 59, 60, 62, 63, 75, 76, 82, 85, 87, 90, 93, 94, 95, 97, 99, 102, 107, 108, 109, 110, 115, 117, 119, 120, 122, 125, 126, 127, 141, 143, 147, 148, 153, 155, 158, 162, 165, 167, 170, 173, 175, 179, 180
Offset: 1
The binary indices of 165 are {1,3,6,8}, with qualifying set partitions {{1,8},{3,6}}, and {{1,3,6,8}}, so 165 is in the sequence.
The terms together with their binary expansions and binary indices begin:
7: 111 ~ {1,2,3}
13: 1101 ~ {1,3,4}
15: 1111 ~ {1,2,3,4}
22: 10110 ~ {2,3,5}
25: 11001 ~ {1,4,5}
27: 11011 ~ {1,2,4,5}
30: 11110 ~ {2,3,4,5}
31: 11111 ~ {1,2,3,4,5}
39: 100111 ~ {1,2,3,6}
42: 101010 ~ {2,4,6}
45: 101101 ~ {1,3,4,6}
47: 101111 ~ {1,2,3,4,6}
49: 110001 ~ {1,5,6}
51: 110011 ~ {1,2,5,6}
54: 110110 ~ {2,3,5,6}
59: 111011 ~ {1,2,4,5,6}
60: 111100 ~ {3,4,5,6}
62: 111110 ~ {2,3,4,5,6}
63: 111111 ~ {1,2,3,4,5,6}
Set partitions with all equal block-sums are counted by
A035470.
A070939 gives length of binary expansion.
-
bix[n_]:=Join@@Position[Reverse[IntegerDigits[n,2]],1];
sps[{}]:={{}};sps[set:{i_,_}]:=Join@@Function[s,Prepend[#,s]& /@ sps[Complement[set,s]]]/@Cases[Subsets[set],{i,_}];
Select[Range[100],Length[Select[sps[bix[#]],SameQ@@Total/@#&]]>1&]
A359041
Number of finite sets of integer partitions with all equal sums and total sum n.
Original entry on oeis.org
1, 1, 2, 3, 6, 7, 14, 15, 32, 31, 63, 56, 142, 101, 240, 211, 467, 297, 985, 490, 1524, 1247, 2542, 1255, 6371, 1979, 7486, 7070, 14128, 4565, 32953, 6842, 42229, 37863, 56266, 17887, 192914, 21637, 145820, 197835, 371853, 44583, 772740, 63261, 943966, 1124840
Offset: 0
The a(1) = 1 through a(6) = 14 sets:
{(1)} {(2)} {(3)} {(4)} {(5)} {(6)}
{(11)} {(21)} {(22)} {(32)} {(33)}
{(111)} {(31)} {(41)} {(42)}
{(211)} {(221)} {(51)}
{(1111)} {(311)} {(222)}
{(2),(11)} {(2111)} {(321)}
{(11111)} {(411)}
{(2211)}
{(3111)}
{(21111)}
{(111111)}
{(3),(21)}
{(3),(111)}
{(21),(111)}
The version for compositions instead of partitions is
A358904.
A001970 counts multisets of partitions.
-
Table[If[n==0,1,Sum[Binomial[PartitionsP[d],n/d],{d,Divisors[n]}]],{n,0,50}]
-
a(n) = if (n, sumdiv(n, d, binomial(numbpart(d), n/d)), 1); \\ Michel Marcus, Dec 14 2022
A381872
Number of multisets that can be obtained by taking the sum of each block of a multiset partition of the prime indices of n into blocks having a common sum.
Original entry on oeis.org
1, 1, 1, 2, 1, 1, 1, 2, 2, 1, 1, 2, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 1, 3, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 2, 1, 1, 1
Offset: 1
The prime indices of 144 are {1,1,1,1,2,2}, with the following 4 multiset partitions having common block sum:
{{1,1,1,1,2,2}}
{{2,2},{1,1,1,1}}
{{1,1,2},{1,1,2}}
{{2},{2},{1,1},{1,1}}
with sums: 8, 4, 4, 2, of which 3 are distinct, so a(144) = 3.
The prime indices of 1296 are {1,1,1,1,2,2,2,2}, with the following 7 multiset partitions having common block sum:
{{1,1,1,1,2,2,2,2}}
{{2,2,2},{1,1,1,1,2}}
{{1,1,2,2},{1,1,2,2}}
{{2,2},{2,2},{1,1,1,1}}
{{2,2},{1,1,2},{1,1,2}}
{{1,2},{1,2},{1,2},{1,2}}
{{2},{2},{2},{2},{1,1},{1,1}}
with sums: 12, 6, 6, 4, 4, 3, 2, of which 5 are distinct, so a(1296) = 5.
With equal blocks instead of sums we have
A089723.
Positions of terms > 1 are
A321454.
With distinct instead of equal sums we have
A381637, before sums
A321469.
A265947 counts refinement-ordered pairs of integer partitions.
Other multiset partitions of prime indices:
-
prix[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
sps[{}]:={{}};sps[set:{i_,_}]:=Join@@Function[s,Prepend[#,s]&/@sps[Complement[set,s]]]/@Cases[Subsets[set],{i,_}];
mps[mset_]:=Union[Sort[Sort/@(#/.x_Integer:>mset[[x]])]&/@sps[Range[Length[mset]]]];
Table[Length[Union[Sort[Total/@#]&/@Select[mps[prix[n]],SameQ@@Total/@#&]]],{n,100}]
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