A simple bijection between $\mathbb{N}$ and $\mathbb{Z}\times\mathbb{Z}$ (naturals and pairs of integers) I think I can use a bijection between $\mathbb{Z}$ and $\mathbb{N}$ to transform $\mathbb{Z}\times\mathbb{Z}$ into $\mathbb{N}\times\mathbb{N}$ and then use the Cantor pairing function, but is there an explicit bijection with fewer computational steps?

The function $f=\left( -1\right)^n\lfloor \frac{n}{2}\rfloor$ bijects $\mathbb{N}$ with $\mathbb{Z}$ if we define $0\notin\mathbb{N}$. (Whatever bijects with this definition of $\mathbb{N}$ can trivially be modified otherwise with the shift $n\mapsto n-1$.) The function $g\left(2^k r\right)=\left(k+1, \frac{r+1}{2}\right)$ with $r$ odd bijects $\mathbb{N}$ with $\mathbb{N}^2$. Thus the function $h\left(2^k r\right)=\left(f\left( k+1\right), f\left(\frac{r+1}{2}\right)\right)$ bijects $\mathbb{N}$ with $\mathbb{Z}^2$. 
