Collatz conjecture

collatz

Think of an positive integer.

If it is equal to 1, stop.

If it is even, divide it by 2.

If it is odd, multiply it by 3 and add 1.

With the new number you get, repeat the instructions above.

If you picked the number 6, your sequence would look like this:

3, 10, 5, 16, 8, 4, 2, 1

Did your sequence end up at 1? Mathematicians have guessed (hypothesised) that all starting choices will eventually end up at 1, but no one has been able to prove this. If you can find just one example that disproves this theory then you could claim a prize of 120 million Japenese YenHere is a fun example of a counterexample that took a long time to find.

Try a few starting numbers by hand. Then you could try and use the power of a spreadsheet such as Geogebra, or by writing some code on Python and let the computer do the hard work for you!

Open up Geogebra.

You will need to use the Mod  command:

Mod[ <Dividend Number>, <Divisor Number> ]

to check if the number is even.

and the If command:

If[ <Condition>, <Then>, <Else> ]

to choose what to do if it is even and what to do if it is odd.

Put together, here is the formula you should put into cell A2, once you have put a starting number in A1.

=If[Mod[A1, 2] == 0, A1 / 2, A1*3 + 1]

Then just hover your mouse pointer in the bottom right corner and click the left button and hold down and drag down lots of cells. You should see the sequence appear.

If you want to be super clever you could try and combine two If statements so that if the cell was equal to 1 it would stop calculating and just say “STOP”.

You could also try this activity on Python, click on the menu bar on the top left to make it full screen.

Good luck!

Leave a Reply

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