def Syracuse(n): if n%2==0: n=n/2 else: n=3*n+1 return n N=int(input("Entrer N =")) while N!=1: print(N) N=Syracuse(N) print(1)