OFFSET
1,4
COMMENTS
The Heinz number of an integer partition (y_1, ..., y_k) is prime(y_1) * ... * prime(y_k).
EXAMPLE
The a(24) = 12 matrices whose entries are (2,1,1,1):
[1 1 1 2] [1 1 2 1] [1 2 1 1] [2 1 1 1]
.
[1 1] [1 1] [1 2] [2 1]
[1 2] [2 1] [1 1] [1 1]
.
[1] [1] [1] [2]
[1] [1] [2] [1]
[1] [2] [1] [1]
[2] [1] [1] [1]
MATHEMATICA
primeMS[n_]:=If[n==1, {}, Flatten[Cases[FactorInteger[n], {p_, k_}:>Table[PrimePi[p], {k}]]]];
facs[n_]:=If[n<=1, {{}}, Join@@Table[Map[Prepend[#, d]&, Select[facs[n/d], Min@@#>=d&]], {d, Rest[Divisors[n]]}]];
ptnmats[n_]:=Union@@Permutations/@Select[Union@@(Tuples[Permutations/@#]&/@Map[primeMS, facs[n], {2}]), SameQ@@Length/@#&];
Array[Length[ptnmats[#]]&, 100]
CROSSREFS
KEYWORD
nonn
AUTHOR
Gus Wiseman, Jan 12 2019
STATUS
approved