I dont understand why the question is still closed. There is no way to explain it further. Someone answered so people can understand the question. Please reopen so I can get more helpful answers. Thank you for your consideration. Is there a way to find the $k$-th permutation of a list $v$ having $n$ items, i.e. ${(1,...,n)}$, where $1\le k\le n!$ and $n!$ is total number of permutations, using an algorithm/equation with a few inputs?
I am not familiar with this problem so bear with me.
Say we have the following sequence: $v={\{1, 2, 3, 4, 5, 6, 7, 8\}}$. There is a total of $P= 8!=40320$ permutations and out aim is to find permutation $k=2500$. Is it possible instead of listing all the possible permutations of the $v$ to formulate an equation/algorithm which may take a few inputs and can generate the k-th permutation? For instance, using MATLAB, the $k=2500$-th permutation is $v(2500)= [8, 4, 5, 1, 7, 3, 2, 6]$
Yes there is, via the factorial number system.
Very roughly, if you have $n$ items and you want to find the $k$-th permutation of them (with $1 \leq k \leq n!$), you follow the algorithm:
Start with the list $\{1, 2, \ldots, n\}$.
Find the largest integer $m$ such that $m \times (n-1)! > k$.
Select the $m$-th entry remaining the list as the next element of the permutation, and remove it from the list.
If the list is not yet empty, set $k := k - (m-1)(n-1)!$ and $n := n - 1$ and go back to 2.
If you're uncomfortable with storing a number up to $n!$ cleanly, then you can much more simply just take in a sequence $a_1, a_2, \ldots, a_n$ where $1 \leq a_i \leq n - i$ and essentially just use it as the values of $m$ to iterate step 3 from the above over the list.