Gapplet

For a permutation, that is, an element of Sn for some n, we compute its order. Observe that it is the lcm of the lengths of the cycles of the permutation when given in disjoint cycle form.

Input a permutation in Sn, e.g., 
  (1,2)(3,4,5)(6,7,8,9) when n = 9.
 
Determine the order of the permutation.