Combinatorica`
Combinatorica`

RankPermutation

RankPermutation[p]

gives the rank of permutation p in lexicographic order.

Details and Options