Files
cybr108/lab-05/exercise-18.py
T
2026-10-12 10:50:19 -04:00

5 lines
283 B
Python

"""
The Collatz conjecture states that if you start with any positive integer n, and if n is even, divide it by 2; if n is
odd, multiply it by 3 and add 1. Repeat the process. The sequence will always eventually reach 1. Write a program to
print this sequence for a given number.
"""