Skip to main content
1 of 6
Joel David Hamkins
  • 236.5k
  • 44
  • 777
  • 1.4k

The down function is moving along the usual Cantor pairing function $\mathbb{N}\times\mathbb{N}\to\mathbb{N}$, since it moves from each point on the diagonals until the diagonal runs out at the y-axis, and then it jumps back to the next lower diagonal.

The cane function counts how many times that happens before you hit the origin. So the cane function is the precisely the inverse of the Cantor pairing function. It maps a pair $(x,y)$ to the code of that pair.

Joel David Hamkins
  • 236.5k
  • 44
  • 777
  • 1.4k