UnrankPermutation

<< DiscreteMath`Combinatorica`

?UnrankPermutation

UnrankPermutation[10,  {1,  2,  2,  2,  3,  4,  4}]

As you can see from the lexcicographically ordered list below, {1, 2, 2, 3, 4, 2, 4} is  not permutation with rank 10. UnrankPermutation should either refuse to accept multisets as its second argument, or it should deal with them correctly. The latter behavior is what we want.

Permutations[{1,  2,  2,  2,  3,  4,  4}]