Simpler description of "hyperbolic" pairing. Look at all the hyperbolas like y = n/x, where n is an int >= 1. Start with y = 1/x, which goes through the point (1, 1); and declare 1 <=> (1, 1). For each successive n, start at (1, n) and slide down y=n/x to (n, 1). As the curve passes through integer points, give each one you pass the next available int label. At the bottom, take the lift up to (n+1, 1). Where Cantor's pairing rides up escalators, this is an infinite day at the infinite ski resort. So, (n = 1) 1 <=> (1, 1), (n = 2) 2<=> (1, 2), 3<=> (2, 1), (n = 3) 4<=> (1, 3), 5<=> (3, 1), (n = 4) 6<=> (1, 4), 7<=> (2, 2), 8<=> (4, 1), (n=5) 9<=>(1, 5), 10<=>(5, 1), (n=6) 11<=>(1, 6), 12<=>(2, 3), 13<=>(3, 2), 14<=>(6, 1)... It can be remembered and programmed from that much. It must have been thought of before but I haven't successfully googled it. (There are hyperbolic pair interactions in physics, and side-pairing transformations in hyperbolic geometry.) I've been trying to optimize speed when I'm more interested how this pairing is optimal for the goal that space_cost( (x, y) ) = ~(space_cost(x) + space_cost(y)). That makes it a point of comparison for more reasonable-to-implement pairings. Also I *think* it relates the law of large numbers to data compression in a cool way. I like that it gets its optimality by just being a list of pairs in order of their products, without being defined in terms of digits, bits, or trees. 30 28 24 21 17 15 11 31 9 25 6 18 32 4 12 22 33 2 7 13 19 26 34 1 3 5 8 10 14 16 20 23 27 29 35 --Steve P.S. d(n) is the number of divisors of n; a conventional name for the sum of d(n) is D(n), the "divisor summatory function." "We are riding the escalator in our dream department store." --Bill Nelson