x = 3 print 0,x for i in range(1,6): if x % 2 == 0: x = x / 2 else: x = (3*x+1)/2 print i,x
Home Page