# Product of cycles to permutation: cycles2permu

### 5.9.4 Product of cycles to permutation: cycles2permu

The cycles2permu command is the inverse of perm2cycles; it turns a sequence of cycles into a permutation.

- cycles2permu takes one argument:
  c, a list of cycles.
- cycles2permu(c) returns the permutation (of size n chosen as small as possible) that is the product of the given cycles.

#### Examples.

- Input:
  cycles2permu([[1,3,5],[2,4]])
  Output:

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

- Input:
  cycles2permu([[2,4]])
  Output:

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

- Input:
  cycles2permu([[5],[2,4]])
  Output:

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