One-Line Notation | Cycle Notation |
---|---|
2 1 3 4 | (12)(3)(4) |
3 2 1 4 | (13)(2)(4) |
4 2 3 1 | (14)(2)(3) |
1 3 2 4 | (1)(23)(4) |
1 4 3 2 | (1)(24)(3) |
1 2 4 3 | (1)(2)(34) |
Let c(n,k) denote the number of permutations of [n] with exactly k cycles. These numbers are known as the Stirling numbers of the First Kind, and satisfy the following recurrence relation:
The algorithm used is from the paper: U. Taylor and F. Ruskey, Fast Generation of Restricted Classes of Permutations, Manuscript 1995.