Hacker News new | ask | show | jobs
How to encode two integers into a single integer (twitter.com)
1 points by helloiloveyou 2182 days ago
1 comments

Alternate the digits, or the bits, of the two numbers and prepend 0's onto the shorter number if needed. Accomplishes this in 2n digits or bits instead of 2^n.