OFFSET
1,4
COMMENTS
A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.
EXAMPLE
The a(90) = 16 matrix-arrangements of (3,2,2,1) with equal column-sums:
[1 2] [2 1] [2 3] [3 2]
[3 2] [2 3] [2 1] [1 2]
.
[1] [1] [1] [2] [2] [2] [2] [2] [2] [3] [3] [3]
[2] [2] [3] [1] [1] [2] [2] [3] [3] [1] [2] [2]
[2] [3] [2] [2] [3] [1] [3] [1] [2] [2] [1] [2]
[3] [2] [2] [3] [2] [3] [1] [2] [1] [2] [2] [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/@#&];
Table[Length[Select[ptnmats[n], SameQ@@Total/@Transpose[#]&]], {n, 100}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Gus Wiseman, Jan 17 2019
STATUS
approved