1 2 3 4 5 6 7 8
num = int( raw_input( 'Enter number: ') ) while num != 4: print num, if num % 2 == 1: num = num * 3 + 1 else: num /= 2 print 4, 2, 1