Mapping tuples (n, m) to the integers, see Cantor pairing function.