Collatz conjecture

Anonymous
plain_text
04/20/2023 7:31 AM
224 B
13
Indexable
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))
Editor is loading...