3 ms·
My favorite way, though, is just to make a grid of pairs of integers (numerator, denominator), and then count them by spiraling outward on the grid. This yields
by slackenerny 17y ago
My favorite way, though, is just to make a grid of pairs of integers (numerator, denominator), and then count them by spiraling outward on the grid. This yields duplicates, but that's ok.
Calkin and Wilf cleverly avoid duplications by arranging reals not on a lattice but on a (Stern-Borcot) tree.
http://en.wikipedia.org/wiki/Calkin%E2%80%93Wilf_tree http://en.wikipedia.org/wiki/Calkin%E2%80%93Wilf_tree
http://www.mathlesstraveled.com/?p=94 http://www.mathlesstraveled.com/?p=94