a = 5 print(a) for n in range(1,21): if a % 2 == 0: a = a / 2 else: a = 5*a + 1 print(a) if a == 1: break