Lothar Collatz was born 6 July 1910 in Amsberg, Westphalia. During his post-doctoral studies at at the age of 27, Collatz developed what is now known as the Collatz Conjecture.

Simply stated, the Collatz Conjecture is defined in terms of the predicted properties of a rudimentary function.

We define Collatz’s function, f, as:

if n is even, divide it by 2, otherwise, multiply by 3 and add 1
The Collatz Conjecture Algorithm

for any positive starting integer n, the conjecture states that repeated iterations of this function will always lead to the cycle { 4, 2, 1 }. In other words, repeatedly applying this function to some starting number will in the long run cause the number to become smaller and that there are no other cycles in the sequence besides { 4, 2, 1 }. To this day, no-one has been able to fully prove this conjecture holds true for all natural numbers but clearly it has for every number as yet tested. Do you think you can find the exception that will prove Lothar wrong?

The inverse function, f-1, is defined as the sequence moving backward from an ending integer through to some initial starting integer that would eventually arrive at the number entered through a series of forward iterations. It is defined as follows:

(n-1)/3 if n ≣ 4 modulo 6 and the user pressed Previous, 2n otherwise
Inverse Collatz Conjecture Algorithm

The Collatz Conjecture, sometimes known as the 3x + 1 problem, is a mathematical supposition which appears deceptively simple yet has defied the defied the greatest minds in mathematics since its discovery by Collatz and has even occasionally appeared in like XKCD or Veritasium‘s YouTube channel.

This application was written by Jeffrey C. Jacobs and is Copyright ©2010–2023 TimeHorse, LLC; source code is available upon request.