Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Create the Lehmer code corresponding to a given permutation
ResourceFunction["LehmerCodeFromPermutation"][perm] creates the Lehmer code corresponding to permutation perm. |
Generate the Lehmer code of a permutation:
| In[1]:= |
| Out[1]= |
Generate the Lehmer code for a particular permutation:
| In[2]:= |
| Out[2]= |
Multiplying by factorials leads to the factorial number system representation or lexicographic index of the given permutation:
| In[3]:= |
| Out[3]= |
The lexicographic index of a permutation works as expected:
| In[4]:= | ![]() |
| Out[4]= |
Wolfram Language 11.3 (March 2018) or above
This work is licensed under a Creative Commons Attribution 4.0 International License