[Tutor] Cantor pairing in three dimensions?

Danny Yoo dyoo at hashcollision.org
Mon Dec 23 19:32:14 CET 2013


I've got a puzzle: so there's a well-known function that maps the
naturals N to N^2: it's called Cantor pairing:

    http://en.wikipedia.org/wiki/Pairing_function

It's one of those mind-blowing things that I love.  I ran across it a
few years ago in a thread on Python-tutor a few years back:

    https://mail.python.org/pipermail/tutor/2001-April/004888.html


Recently, the topic came up again for me, but in an expanded context:

https://plus.google.com/117784658632980303930/posts/4SMcjm2p9vv


So here's the question: is there an analogy of the Cantor pairing
function that maps N to N^3?


More information about the Tutor mailing list