N = int(input("Enter a starting value --- ")) while (N > 1): print (N) if (N % 2 == 0): N = N // 2 else: N = N * 3 + 1 print (N)