I want to map the various combinations to an unique index: For a given $n$ and $r$, we would have $\binom{n}{r}$ arrangement for values:$[0,\dots,n)$:
Ex: For n = 6, r = 3
[012,
013,
014,
015,
...,
345]
So, for any given arrangement [012] the index would 0 as its the very first element.
Similarly, the index for arrangement for [015] should be 3. Trying to come up a formula to determine the correct index for a given arrangement.