I searching for an algorithm which gives me the permutation count of the elements 1....n
. If i define the cycle lengths.
For example n := 4
<Set of cycle lengths>
-> permutation count
1,1,1,1
-> 1
read 4 cycles of length 1 leads to 1 permutation: 1,2,3,4
1,1,2
-> 5
read 2 cycles of length 1 and 1 cycle of length 2 leads to 5 permutations: 1,2,4,3
, 1,4,3,2
, 1,3,2,4
, 2,1,3,4
, 3,2,1,4
,
2,2
-> 3
read 2 cycles of length 2 leads to 3 permutations: 2,1,4,3
, 3,4,1,2
,4,3,2,1
1,3
-> 9
read 1 cycle of length 1 and 1 cycle of length 3 leads to 9 permutations 1,3,2,4
, 1,3,4,2
, 1,4,2,3
, 2,3,1,4
, 2,4,3,1
, 3,1,2,4
, 3,2,4,1
,4,1,3,2
, 4,2,1,3
,
4
-> 6
read 1 cycle of length 4 leads to 6 permutations:
2,3,4,1
, 2,4,1,3
, 3,1,4,2
, 3,4,2,1
, 4,1,2,3
, 4,3,1,2
How can i compute the permutation count of a given set consisting cycle lengths? Iterating through all permutations is not an option.