I was trying to visualize the 3-adic numbers as dots on a plane. The idea was to use the coefficients in each number’s representation as the sum of powers of p to uniquely define a pair of coordinates.
Since the coefficients can only be 0, 1, or 2, the plan was to create a tree (inspired by Bruhat-Tits trees) with three branches at each level. To stop the points from overlapping, the length of the branches decreases geometrically.
To find a number’s position on the plane, start at the center, and consider the second coefficient. Traverse the left-most branch if the coefficient is 0, the center branch for a coefficient of 1, and the right-most branch if the coefficient is 2. Then, repeat this process for the next coefficient, etc. An example is given below.
I first expected to produce a deformed version of of the Bruhat-Tits tree linked above, because I decided to be lazy and keep the branches at right angles. Plotting the final positions of every possible set of (a small number of ) choices with random colors produced this beautiful, unexpected result.
Increasing the circle size, and adding more layers so that the circles overlap produces this trippy triangle.
UPDATE: Although this is pretty to look at, it’s not exactly what I wanted to show, since the sketch demands the pattern “curl up” at the top. Revisiting and simplifying the code produced a more reasonable result:
This program is written in Python and requires the Pillow and Numpy modules, both of which are available using pip.