I am looking for a simple expression to convert ordered pairs from $[0,n]$ to the first smallest subset of $\mathbb N$. For example if $n = 3$:
$$ (0, 1) \rightarrow 0$$ $$ (0, 2) \rightarrow 1$$ $$ (0, 3) \rightarrow 2$$ $$ (1, 2) \rightarrow 3$$ $$ (1, 3) \rightarrow 4$$ $$ (2, 3) \rightarrow 5$$
What could be an explicit formula for that?
To rephrase, I am looking for a formula $f_n(i, j)$ where $0 \le i < j \le n$ such that $0 \le f_n(i, j) < \left ( ^{n}_{2}\right )$ and $f_n$ is bijective. I would also like if possible the inverse bijection to retrieve $i$ and $j$ from an image of $f_n$.
The values of the function do not matter as long as the set of values is the same.
Cantor pairing functions are not applicable here because the bijection is not infinite.