Quite a while ago, I presented the Collatz conjecture and I was then interested in the graphical representation of the problem—and not really going anywhere with it.
In this entry, let us have a look at the implementation of the Collatz function.
Mathematics is still full of surprises. The solution to simple to state problems may elude mathematicians for centuries. One example is the celebrated Fermat’s Last Theorem (stating that equations of the form have no integer-only solutions for ) that was finally solved by Andrew Wiles with tools Fermat couldn’t possibly know nor understand1.
Another one of those problems is the Collatz Conjecture. Proposed by Lothar Collatz in 1937, the conjecture is that a simple recurrence function—that we will discuss in detail in just a moment—terminates for all natural numbers. This one, however, isn’t solved yet.