Coprime stars

In college (2004), I was exposed to an iterator that could generate a list of all rational numbers. Only one problem for me. It was out of order. I immediately went to work recreating the iterative sequence such that I could list all rational numbers in order. Now, this is where you should say, Hold it! You can't list consecutive rational numbers! There will always be another rational number between. And you would be correct. My points exactly actually.

In 2008, I had the clever idea to draw it out; not in terms of rational numbers anymore, but as a plot of coprime pairs. To be specific, I defined a sequence of sequences. To illustrate these sequences, I made a plot in Mathematica of the new coprime points at each iteration.

The explosion of coprime points
Plot of the coprime points generated in recursive layers

Now in 2014, I am revisiting this iterative sequence. Here is my latest definition of it.

  1. First I define a short sequence of points of length 5.
    \[ B_{0}(y) = \{(1, 0), (0, 1), (-1,0), (0,-1), (1, 0)\} : y \in \{0, 1, 2, 3, 4\} \]
  2. And then I recursively define larger sequences \( B_{0}(y) \) (\( x \ge 1 \)) of length \( 2^{x+2}+1 \).
    \[ B_{x}(y) = \left\{ \begin{array}{lr} B_{x-1}(\frac{y}{2}) & y \text{ is even} \\ B_{x-1}(\frac{y-1}{2}) + B_{x-1}(\frac{y+1}{2}) & y \text{ is odd} \end{array} \right. \]
    So, the larger that \( x \) gets, the more coprime points \( B_{x} \) contains.
  3. Finally, to get the sequence of sequences plotted above, I only plot the points when \( y \) is odd at each successive iteration to observe the fractal in its full beauty.

Updates in 2015

This sequence is intrinsically related to the GCD when calculated by subtraction (as opposed to division). I created this GCD calculator to demonstrate both methods.

Better than saving off an image, I have coded the following webgl sketch for our viewing pleasure.