Pensieve Header: A short program to compute cycle decompositions and immanants.

p=Permutations[{1,2,3,4,5}][[69]]

c=Range[5]

q=p

c=MapThread[Min, {c, c[[q]]}]

q=q[[q]]

c=MapThread[Min, {c, c[[q]]}]

q=q[[q]]

c=MapThread[Min, {c, c[[q]]}]

Cycles[p_List] := Cycles[p] = Module[
{q=p, c},
FixedPoint[
(c=MapThread[Min, {#, #[[q]]}]; q=q[[q]]; c)&,
Range[Length[p]]
];
Reverse[Sort[Last /@ Tally[c]]]
]

Tally[Cycles /@ Permutations[Range[6]]]

Immanant[M_?MatrixQ] := Module[
{n=Length[M],ps, p},
ps=Permutations[Range[n]];
Sum[
p=ps[[i]];
(YT@@Cycles[p]) * (Times @@ (M[[#, p[[#]]]]& /@ p)),
{i,n!}
] /; Dimensions[M] == {n,n}
]

Immanant[{{1,2},{3,4}}]

Immanant[Partition[Range[9],3]]