Collatz Conjecture – An Excel model

The other day I was leafing through ‘Professor Stewart’s Hoard of Mathematical Treasures‘ whilst waiting for the bath to run and started reading about the Collatz Conjecture, a theory which states that, if you start with any number and apply the following logic to it:-

If the number is even, divide it by 2


If the number is odd, multiply it by 3 and add 1

…and continue to do this for each resulting number, you will eventually always get to number 1.  The theory, known also as The Ulam Conjecture, The Syracuse Problem and some others hasn’t as yet been proved, and still stumps mathematicians to this day.

I didn’t want to prove/disprove it, I just wanted to play with it a little, so I build this little plaything for fun.  Download it and have a go.  It takes any figure you enter and runs the process above on it and its results until it inevitably reaches one.  I put the sheet together using some pretty simple VBA, as well as using some conditional formatting and other tricks here and there.  The whole sheet is unprotected so you can have a look at how things work.  I added the chart for no reason other than showing the pattern of numbers – smoothing has been added to the line to make it look more pretty but other than that it’s no use other than to fill up some space on the sheet.

I find it really interesting that some initial ‘seeds’, if you like, can create some pretty wild reactions.  Look at what happens to 11, for example:-

This tool/model won’t solve the problem, by the way.  Every number you can possibly type into Excel will always return 1 – it’s still possible however that there is some huge number out here that doesn’t..



  • Greg Lewis
    October 2, 2013 - 12:48 am | Permalink

    Having seen the proof otherwise, I’ve got to wonder what evidence exists that would demonstrate that there is some *huge* number out there that does not.

    Edited for typo.

  • December 18, 2015 - 9:43 pm | Permalink

    Is there some other loop we could get stuck in? Or is it even possible that there are some stiatrng numbers from which the successive numbers will just keep getting bigger and bigger and never loop at all? If you think that last option isn’t possible, try stiatrng with a number like 27: I am currently working on a proof for the Collatz conjecture, and can add a bit more insight into the above.To answer the first question: is there some other loop than the 4,2,1,4 loop could we get stuck in? The answer is no, I have a solid proof of why there isn’t, but since it isn’t published I don’t want to give this away, but I can prove this 100% for sure(verified by several mathematicians at my university).Will the numbers get bigger and bigger? This question I have been trying to disprove but have a hard time disproving the {infinity, , k, , infinity} sequence. This is the part I am currently working on, either disproving this, or proving the {infinity, , k, , 4, 2, 1, 4, } sequence is the only one possible for any integer k, therefore proving the conjecture.Any possible integer in the set of natural numbers will lead to a number in the following set {4, 10, 16, , 6n + 4}, if you draw out the Collatz graph in mod 6( 0->0 until reaches odd number, if so 0->3->4, from 4 you have 3 cycles the 4->2->4 cycle, the 4->5->4 cycle, and the 4->2->1->4 cycle, so as you see if you start with any number eventually you will reach a 4 mod 6 integer. Every integer in the set {4, 10, 16, , 6n + 4} has 2 possible prior integers either 1) you divided by 2, so any number from {8, 20, 32, , 12n + 8} or 2) you multiplied by 3 and added 1, which means the second value is found in one of the 3 following sets {1, 7, 13, , 6n + 1}, {3, 9, 15, , 6n + 3}, {5, 11, 17, , 6n + 5}. So this means the size of the set of integers in the k-1 position in the sequence will be 2x as large as the kth position in the sequence, and decreases in factors of 2 for each 4 mod 6 value we loop through during the sequence. The {infinity, , k, , infinity} sequence therefore cannot be possible since if you take the size of the set of all numbers at position k in this sequence, as s, then s would eventually decrease to a fractional number of a number between 0 and 1, and since s has to be an integer value, therefore the {infinity, , k, , infinity} sequence cannot exist.This is my formal argument currently for that point, unfortunately you have problems if you take s to be infinity, and every s of position k would also be infinity, just less and less dense each time, so this is the only problem I can see with the argument I proposed above for this, any way around this?The reason why 27 has a long sequence compared to it’s neighbours is because it is a 0 mod 3 value. All 0 mod 3 values will have a longer sequence than their neighbours, if you look at the inverse Collatz graph in mod 6, you will notice that 3 mod 6 -> 0 mod 6 loop infinitly part of the graph will act as a sink, meaning if you start at any other number, you will loop through the 1, 2, 4, 5 mod 6 values an unspecified number of times until you reach a 3 mod 6 value, then never be able to come back. So as you see in the inverse Collatz graph you will always reach the 3 mod 6 values last, and therefore these are the longest since if you keep branching outwards you will eventually reach this value and stay there, by the cycle/sink mathematics theories. In essense 3 mod 6 acts as a sink, and the sequence stiatrng from {3, 6, 3n + 3} must go through all other integers of 1, 2, 4, 5 mod 6 prior to entering the 4, 2, 1, 4 cycle, asssuming the conjecture is true.

  • Leave a Reply

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