Let say I have a sequence [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] and I want to retrieve the 4th element of the 1,000,000th permutation of this list.
I know how to compute the 1,000,000th permutation of the sequence using the algorithm explained here : Finding the n-th lexicographic permutation of a string
This permutation is [2 7 8 3 9 1 5 4 6 0], and so the 4th element is 3.
But is there a faster way to find "3", I mean except stopping computing the permutation after the 4th element?