1 video

Collatz

Halve it if even, triple it and add 1 if odd. Every number seems to reach 1.

Pick any whole number. If it is even, halve it. If it is odd, triple it and add 1. Repeat. Every number anyone has ever tried ends up at 1, and then loops 4 → 2 → 1 forever. Nobody can prove that this always happens. This series draws those paths.

How it works

The rule. For a number n, the next number is n/2 if n is even, and 3n + 1 if it is odd. Starting from 6, for example: 6 → 3 → 10 → 5 → 16 → 8 → 4 → 2 → 1.

Up and down, with no pattern. Tripling pushes numbers up and halving brings them down. Every odd step is followed by at least one halving, since 3n + 1 is even when n is odd. Counting how often each happens on average, the halvings win in the long run, which is why most paths fall. But the average proves nothing about any one number, and some small starts climb very high. 27 takes 111 steps and peaks at 9,232.

Paths merge. Every path ends …8 → 4 → 2 → 1, and once two paths reach the same number they stay together from then on. So all the paths together form a single tree with 1 at its root. Drawn backwards from 1, with a small turn one way for every even number and a bigger turn the other way for every odd one, the tree looks like a plant.

The open question. The Collatz conjecture says every start reaches 1. It could fail in two ways: a path that climbs forever, or a loop that never reaches 1. Computers have checked every start up to about 2⁶⁸ and found neither. It has been open since Lothar Collatz posed it in 1937.

In the video

No. 023 follows 27's path, then draws every path from 1 to 10,000 backwards, turning +0.135 radians on every even number and −0.27 radians on every odd one. The longest trip up to 10,000 belongs to 6,171: 261 steps, peaking at 975,400.

Go further

Try it

Compare 27 with its neighbours 26 and 28, then type 6171 for the longest trip below 10,000.