""" John Rachlin DS 2000: Intro to Programming with Data Date: Wed Sep 21 21:07:07 2022 File: collatz.py Description: A demonstration of the collatz conjecture. Do not pay attention to this lecture! You may become obsessed with the collatz conjecture and waste your life trying to solve it!! Please ignore everything I'm about to say!!! This means you. Collatz Conjecture: Start with any positive integer, X > 0 If X is even: X -> X / 2 If X is odd : X -> 3X + 1 For ANY X, you eventually reach a repeating cycle: 4 -> 2 -> 1 -> 4 -> 2 -> 1 ... """ def main(): x = int(input("Enter any positive integer: ")) steps = 0 while x != 1: if x % 2 == 0: x = x // 2 else: x = 3 * x + 1 steps = steps + 1 print(steps, x) main()