Cantor pairing function (source code)

= Cantor pairing function
{c}

The Cantor pairing function is an explicit <bijection> between $\mathbb N^2$ and $\mathbb N$, obtained by enumerating lattice points along successive diagonals.