Here is a very simple math problem:
If a number is even, divide the number by two. If a number is odd, multiply the number by three, and then add one. Do this over and over with your results. Will you always get down to the value 1 no matter what number you choose?
Go ahead and test this out for yourself. Plug a few numbers in. Try it out. I’ll wait.
Back? Good. Here’s my example: I start with the number .
is even, so I divide it by .
is odd, so we multiply it by then add .
And we have arrived at one, just like we thought we would. But is this ALWAYS the case, for ANY number I could possibly dream of?
This may sound easy, but in fact it is an unsolved mathematics problem, with some of the best minds in the field doing research on it. It’s easy enough to check low values, but numbers are infinite, and can get very, very, very large. How do we KNOW that it works for every single number that exists?
That is what is so difficult about this problem. While every single number we have checked (which is a LOT) ends up at 1 sooner or later (some numbers can bounce around for a very long time, hence why they are called “hailstone sequences”), we still have no method to prove that it works for every number. Mathematicians have been looking for some method to predict this, but despite getting into some pretty heavy mathematics in an attempt to attack this problem, we still do not know for sure.
This problem is known as the Collatz Conjecture and is very interesting to mathematicians young and old because it is so easy to explain and play with, yet so tough to exhaustively prove. What do you think? Will this problem ever be solved? And what would be the implications if it was?
Here is some simple Python code that can display the cycles for any number you type in:
num = int(input("Enter a number: "))
if num%2 == 0:
num = num/2
num = (num*3)+1