c=int(input())while c!=1: if c%2==0: c/=2 else: c=3*c+1 print(c)
5
16 8.0 4.0 2.0 1.0
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!