'Computes the order of a permutation.
When the permutation is raised to the power of its
order it equals the identity permutation.
Examples
>>> from sympy.combinatorics.permutations import Permutation
>>> Permutation.print_cyclic = False
>>> p = Permutation([3, 1, 5, 2, 4, 0])
>>> p.order()
4
>>> (p**(p.order()))
Permutation([], size=6)
See Also
identity, cardinality, length, rank, size'

def order(self):

    return reduce(lcm, [len(cycle) for cycle in self.cyclic_form], 1)
