'The maximum element moved by the permutation.
Examples
>>> from sympy.combinatorics.permutations import Permutation
>>> p = Permutation([1, 0, 2, 3, 4])
>>> p.max()
1
See Also
min, descents, ascents, inversions'

def max(self):

    max = 0
    a = self.array_form
    for i in range(len(a)):
        if ((a[i] != i) and (a[i] > max)):
            max = a[i]
    return max
