Working with abstract algebra? See order (abstract algebra)

Returns the order of a permutation, that is the number of times a permutation p should be composed with itself in order to achieve the identity. If the permutation is represented by cycles, the order is the least common multiple of the length of the cycles.


Given a permutation, returns its order.