Pensieve Header: Code for http://katlas.math.toronto.edu/drorbn/bbs/show?shot=Chterental-110630-160804.jpg ; also includes code for counting cycles in a permutation. See also http://katlas.math.toronto.edu/drorbn/AcademicPensieve/2009-07/nb/Immanants.pdf.

p={6,5,4,1,2,3}

m=Range[Length[t=p]];
m=MapThread[Min, {m,m[[t]]}];
t=t[[t]]; m=MapThread[Min, {m,m[[t]]}]

CycleCount[p_List] := Module[
{m,t=p},
Length[Union[FixedPoint[(
t=t[[t]]; 
MapThread[Min, {#,#[[t]]}]
)&,
MapThread[Min, {Range[Length[p]], p}]
]]]
]

CycleCount[{6,5,4,1,2,3}]

(# -> CycleCount[#])& /@ Permutations[Range[4]]

PairingPermutation[a_] := Reverse[Range[2a]];
PairingPermutation[a_, bs__] := Join[
PairingPermutation[a],
2a+PairingPermutation[bs]
]

PairingPermutation[1,3,7]

PairingCycles[as__] := CycleCount[1+2Plus[as]-PairingPermutation[as]]/2

PairingCycles[1,3,7]

Table[PairingCycles[i,j], {i, 10}, {j,10}] // MatrixForm

Table[PairingCycles[3,5,i], {i, 50}]