Q:

Invertible function $\mathbb{N} \times \mathbb{N} \to \mathbb{N}$

I am trying to find out if it is possible to create an invertible function from $\mathbb{N} \times \mathbb{N} \to \mathbb{N}$?
Can you help me? Where should I start? Is it related with the Cantor pairing function?

A:

The following function, used to produce a total order on $\mathbf N^*$ different from the usual order, is a bijection:
\begin{align*}
\mathbf N\times\mathbf N&\longrightarrow\mathbf N^*\\
(n,p)&\longmapsto 2^n(2p+1)
\end{align*}
Hence the function
$$f(n,p)= 2^n(2p+1)-1$$
satisfies the requirements.

