Collatz Seaweed

A visualisation of the Collatz conjecture: every number's path back to the 1, 2 loop.

2016-01-01

Method
generative
Year
2016
With
Alex Bellos

When Alex Bellos and I were writing the second colouring book Visions of the Universe, we wanted to include the Collatz conjecture and needed to find an illustration for it. Inspired by xkcd I thought to add geometry to the collatz tree. Following the numberphile video this became a cottage industry of Collatz illustrations, including the illustrations used in a Veritasium video1 and many other places. We also posted about it in New Scientist.

This credit is a slight injustice. Researching this writeup I found a very similar illustration had been made a year earlier, and placed in a Reddit post, by user level1807. This is credited in the page on the software used to make the illustration on wikipedia.

Animation of Collatz paths accumulating into a dense, seaweed-like tangle
The paths accumulating, from a handful of numbers into a dense tangle.

The Collatz process is brutally simple: take a whole number x, halve it if it is even to get x/2x/2, and apply (3x+1)/2(3x+1)/2 if it is odd. Halving makes numbers smaller, but the odd step makes them larger, and the two pull against each other. Every number anyone has tested eventually falls into the loop 1, 2, 1, 2, yet there is no proof that every number must. Paul Erdős said that “mathematics is not yet ripe enough for such questions.”

This image draws the journey each number takes back to that loop. A path turns left when its number is halved and right when it is tripled, and all the paths are lined up to arrive at the same place. Drawing every starting value up to 60,000 produces a tangle that looks less like rigid arithmetic and more like windblown seaweed.

A few Collatz paths drawn as thin branching lines, turning left and right as numbers halve or triple
An early segment of the paths, before the tangle builds up.

As more paths accumulate the structure grows like seaweed, or some Lovecraftian growth, rather than rigid mathematics. Perhaps that unruly form is a hint at why the underlying pattern has been so hard to pin down.

Coverage: New Scientist — Mathematics has a bad hair day (2017) · Numberphile (video)

Footnotes

  1. The video credits youtube channel Algoritmarte, and they credit the numberphile video.