5

quadratic scheme

We can consider the quadratic scheme above for a possible explicit bijection between $\mathbb N$ and $\mathbb N \times \mathbb N$.

The part $\mathbb N \times \mathbb N \to \mathbb N$ is easy via $(m,n) \mapsto m + \frac{(n + m)\cdot(n + m + 1)}{2}$ for $m$ going down (as row index) and $n$ going right (as column index).

Consider $(0,0) \mapsto 0$ and $(2,1) \mapsto 8$ and $(3,2) \mapsto 18$ as examples.

What ist the other map $\mathbb N \to \mathbb N \times \mathbb N$?

Achilles
  • 251

1 Answers1

4

For $s \in \mathbb N$ define $r := \left\lfloor \frac{-1 + \sqrt{1 + 8 \cdot s}}{2}\right\rfloor$.

Then, $m := s - \frac{r \cdot (r + 1)}{2}$ and $n := r - m$ and so $s \mapsto (m, n)$.

Curiosity
  • 716