Hacker News new | ask | show | jobs
by anatoly 5689 days ago
Here's the easiest way I can think of to imagine an ordering that works for what you need. Imagine an infinite square lattice: a plane where the As lie on one axis and the Bs on the other, and there's a dot in every integer-coordinates point. Now just do a "spiral", for example counterclockwise: 0,0 -> 1,0 -> 1,1 and keep unwinding your way to infinity. The exact formulas can be written out but intuitively it should be enough to convince you it works even without them.