Python-created visualization of the Collatz conjecture for 5,000 random starting points. Starting from the tree “root,” the path turns left at even nodes and right at odd nodes, with the color, and thickness of each line dependent on how often a particular return sequence is encountered. Details under “Collatz conjecture” on Wikipedia. Credit: Dkobak, Creative Commons

“Mathematics may not be ready for such problems.” — Legendary mathematician Paul Erdős, commenting on the Collatz conjecture

“Easy to state, hard to prove.” That’s the case for a handful of numerical curiosities that have driven mathematicians crazy — sometimes literally — over the years. Case in point, the Goldbach conjecture (“How to Win $1,000,000,” Nov. 7, 2019), simply stated as, “Every even number is the sum of two primes.” Prove it and a cool million dollars awaits. Here’s another one. It goes by several names, but either the “Collatz conjecture” (posed by German mathematician Lothar Collatz in 1937) or the “3n + 1 problem” will raise knowing eyebrows around any math nerds: 

• Start with any positive integer n

• If n is even, the next number is n/2

• If n is odd, t he next number is 3n + 1

• Repeat the process with the new number until you end up at 1.

That’s it. What Collatz realized is that 1 always — always! — awaits, no matter what number n you start with. For instance:

n = 12, so you go 12 – 6 – 3 – 10 – 5 – 16 – 8 – 4 – 2 – 1.

n = 13, so 13 – 40 – 20 – 10 – 5 – 16 – 8 – 4 – 2 – 1. Notice once you got to 10, you followed the same sequence as previously.

(Both of those runs were nine steps long, but the sequence length varies wildly. The innocent-looking starting number 27 takes a total of 111 steps, climbing as high at 9232, to get to 1, while its neighbor 26 takes just 10 steps.)

Why doesn’t the sequence sometimes go off to infinity? Or get stuck in an endless loop? That’s the challenge. Figure it out and I’m pretty sure you’d get a Fields Medal (the math equivalent of the Nobel Prize). When I say you always end up at 1, I mean it’s true for every n that computers have checked, all the way up to 2 followed by 21 zeros. So while the conjecture seems solid, just one counterexample would disprove it. Maybe somewhere, way out on the number line, far beyond where computers have checked, there lurks a huge number that doesn’t lead to 1. How do we know that isn’t the case? We don’t. That’s what makes the Collatz conjecture so infuriating. It’s such a simple premise — a third-grade kid can grasp it — but insanely hard (perhaps impossible) to prove.

Countless mathematicians have spent years fruitlessly trying to prove what looks, at first blush, like a walk in the park. One thing mathematicians can do, using high-level, general-purpose computer programs such as Python, is to let us visualize the conjecture. Recall, it was the visuals that made the Mandelbrot set so attractive soon after mathematician Benoit Mandelbrot discovered it in 1980, a finding that jump-started the science of fractal geometry (fractal shapes are equally rough at all scales). The accompanying illustration is one way to visually describe the Collatz conjecture, starting with 5,000 random numbers below 1 million, each line representing a path taken to get back to 1. 

Want to take a stab at it? Shouldn’t take more than an hour or two.

Barry Evans (he/him, barryevans9@yahoo.com) wasted the better part of an evening trying to prove it.

Leave a comment

Your email address will not be published. Required fields are marked *