Interactive demo
Visualizing the Collatz Conjecture
The Collatz conjecture is a mathematical conjecture by Lothar Collatz that is still unproven to this day. It looks for a number n ∈ ℕ that, after processing the algorithm, does not get back to the same rhythm 4 → 2 → 1 → 4.
How is this algorithm defined?
Take an arbitrary value n. If it's even, divide it by 2, and if it's odd, multiply it by three and add one. For example, let's take n = 10: even → 10 / 2 = 5. Then continue until you've reached 1: odd → 5 · 3 + 1 = 16, even → 16 / 2 = 8, even → 8 / 2 = 4, even → 4 / 2 = 2, even → 2 / 2 = 1, and we've successfully reached 1.
A Live Check in Your Browser
By the time you've read this small paragraph, your browser executed the "collatzConjecture.js" file and checked the Collatz conjecture for the first 10k numbers. The conjecture can also be visualized in an image where even numbers are displayed as a small line segment tilted slightly to the left and odd numbers are tilted slightly to the right. You can see the resulting visualization above.
The Search for a Counterexample
Since July 2014, around 4,700 computers worldwide have been trying to find a natural number n that does not follow the described algorithm and would therefore disprove the Collatz conjecture (ref). Numbers above 2,361,183,346,958,000,000,001 are currently being checked.