login
A320328
Number of square multiset partitions of integer partitions of n.
12
1, 1, 2, 3, 6, 11, 20, 36, 65, 117, 214, 382, 679, 1199, 2095, 3656, 6321, 10917, 18721, 32015, 54385, 92040, 154882, 259662, 433263, 720399, 1193046, 1969475, 3239490, 5312015, 8681695, 14145799, 22977171, 37212996, 60092265, 96769448, 155409294, 248934037, 397735789
OFFSET
0,3
COMMENTS
A multiset partition is square if its length is equal to its number of distinct atoms.
EXAMPLE
The a(1) = 1 through a(6) = 20 square partitions:
{{1}} {{2}} {{3}} {{4}} {{5}} {{6}}
{{1,1}} {{1,1,1}} {{2,2}} {{1},{4}} {{3,3}}
{{1},{2}} {{1},{3}} {{2},{3}} {{1},{5}}
{{1,1,1,1}} {{1},{1,3}} {{2,2,2}}
{{1},{1,2}} {{1},{2,2}} {{2},{4}}
{{2},{1,1}} {{2},{1,2}} {{1},{1,4}}
{{3},{1,1}} {{4},{1,1}}
{{1,1,1,1,1}} {{1},{1,1,3}}
{{1},{1,1,2}} {{1,1},{1,3}}
{{1,1},{1,2}} {{1},{1,2,2}}
{{2},{1,1,1}} {{1,1},{2,2}}
{{1,2},{1,2}}
{{1},{2},{3}}
{{2},{1,1,2}}
{{3},{1,1,1}}
{{1,1,1,1,1,1}}
{{1},{1,1,1,2}}
{{1,1},{1,1,2}}
{{1,2},{1,1,1}}
{{2},{1,1,1,1}}
MATHEMATICA
sps[{}]:={{}}; sps[set:{i_, ___}]:=Join@@Function[s, Prepend[#, s]&/@sps[Complement[set, s]]]/@Cases[Subsets[set], {i, ___}];
mps[set_]:=Union[Sort[Sort/@(#/.x_Integer:>set[[x]])]&/@sps[Range[Length[set]]]];
Table[Length[Select[Join@@mps/@IntegerPartitions[n], Length[#]==Length[Union@@#]&]], {n, 8}]
PROG
(Python)
from itertools import groupby
from sympy.combinatorics.partitions import IntegerPartition
from sympy.utilities.iterables import partitions, multiset_partitions
def square(ms): return len(ms) == len(set(e for s in ms for e in s))
def msp(n): # generator of multiset partitions of integer partitions of n
yield from (m for p in partitions(n) for m in multiset_partitions(IntegerPartition(p).partition))
def a(n): return sum(1 for ms in msp(n) if square(ms))
print([a(n) for n in range(20)]) # Michael S. Branicky, Oct 12 2025
KEYWORD
nonn
AUTHOR
Gus Wiseman, Oct 11 2018
EXTENSIONS
a(13)-a(38) from Michael S. Branicky, Oct 12 2025
STATUS
approved