My class enjoyed learning about the collatz conjecture from this numberphiile video...
Its quite easy to do a few examples with pen and paper then create a scratch and/python program to make things go faster.
My scratch code
My Python code
Code: Select all
from time import sleep n = 7 while True: sleep(0.01) if (n % 2): n = 3 * n + 1 print(n) else: n = n // 2 print(n)