Elementary formula for permutations?

Suppose I fix $n$ and let $\sigma_k$ represent the $k$th permutation of $S_n$ with respect to some ordering (whatever ordering might serve my purpose). Is there an elementary formula for $\sigma_k(i)$ which requires only $i, k,$ and $n$?

Is one known for small $n$, perhaps even as small as 4?

Solutions Collecting From Web of "Elementary formula for permutations?"

It depends upon what you mean by elementary. If the ordering is lexicographic, the first element of the $k^{\text(th)}$ permutation of $S_n$ is $\lfloor \frac{k}{(n-1)!}\rfloor$ (assuming the first element of the set is $0$).This leads to an easy recursive function to find the whole $k^{\text(th)}$ permutation.

The magic words are “ranking permutations”; see for example Wilf’s lecture notes.