Collatz conjecture

mail@pastecode.io avatar
unknown
plain_text
a year ago
167 B
1
Indexable
Never
n=int(input("n ="))

while n != 1:
    if n % 2 == 0:
        n=n/2
        result=n
    else:
        n=(n*3)+1
        result=n
    
    print(int(result))