# Transforming a cycle into a permutation: cycle2perm

### 5.9.5 Transforming a cycle into a permutation: cycle2perm

A cycle is a type of permutation, but has a different representation.
The cycle2perm command converts a cycle to the cycle written as a permutation.

- cycle2perm takes one argument:
  c, a cycle c.
- cycle2perm(c) returns the permutation of size n corresponding to the cycle c, where n is chosen as small as possible (see also permu2cycles and cycles2permu).

#### Example.

Input:

cycle2perm([1,3,5])

Output:

⎡ ⎣ | 0,3,2,5,4,1 | ⎤ ⎦