Wolfram Function Repository
Instantuse addon functions for the Wolfram Language
Function Repository Resource:
Check if a list is the inversion vector of a permutation written as a list
ResourceFunction["InversionVectorQ"][iv] checks if iv is the inversion vector of a permutation list. 
This permutation has three numbers greater than 1 before 1, two numbers greater than 2 before 2 and so on:
Therefore this is its inversion vector:
Here is a check:
In[1]:= 

Out[1]= 

The positive integer 23 gives {3,2,1,0} in the factorial base, so {3,2,1,0} is an inversion vector:
In[2]:= 

Out[2]= 

Every inversion vector must end in 0 because the largest entry in a permutation list has nothing but smaller entries before it:
In[3]:= 

Out[3]= 

This work is licensed under a Creative Commons Attribution 4.0 International License