Factor a given a permutation in the set of independent cycles
perm2cycles(perm)
perm
a permutation
The permutation in the input in which the operation has been applied
perm2cycles(c(1,5,2,3,4))