day1/exercise/collatz.py
changeset 64 333092b68926
child 354 5dc6c3673f9d
equal deleted inserted replaced
63:f5eac04a00fe 64:333092b68926
       
     1 a = -1
       
     2 while a > 1:
       
     3     print a
       
     4     if a % 2:
       
     5         a = a * 3 + 1
       
     6     else:
       
     7         a /= 2