day1/exercise/collatz.py
author Madhusudan.C.S <madhusudancs@gmail.com>
Wed, 11 Nov 2009 12:30:18 +0530
changeset 302 8ea4739a7f1f
parent 64 333092b68926
child 354 5dc6c3673f9d
permissions -rw-r--r--
Added tag goaandcalicut-v.10112009 for changeset 49bdffe4dca5

a = -1
while a > 1:
    print a
    if a % 2:
        a = a * 3 + 1
    else:
        a /= 2