OFFSET
1,3
COMMENTS
Row sums equal n! by definition.
LINKS
EXAMPLE
1;
0, 2;
3, 0, 3;
0, 19, 0, 5;
40, 0, 73, 0, 7;
0, 492, 0, 217, 0, 11;
1260, 0, 3225, 0, 540, 0, 15;
0, 24096, 0, 14968, 0, 1234, 0, 22;
MATHEMATICA
(*slow:*)
Table[Rest@CoefficientList[Apply[Plus, Flatten[Outer[ q^Length[ ToCycles[#1[[#2]][[InversePermutation[#1]]][[InversePermutation[#2]]]]] &, Permutations[w], Permutations[w], 1]]], q]/w!, {w, 4}]//Expand;
(*fast:*)
content[(p_)?PartitionQ]:= Block[{le= Max[p], ferr =(PadLeft[1+ 0*Range[#1], Max[p]]&) /@ p}, DeleteCases[ MapIndexed[-le+ Range[le, 1, -1]- #1- Tr[#2]&, 0*ferr]*ferr, 0, -1]+ le];
Table[Rest@ CoefficientList[ Apply[Plus, Apply[Times, q + Flatten[content[#]]] & /@ Partitions[ k ]] , q], {k, 12}]
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Wouter Meeussen, Jun 12 2011
STATUS
approved