day1/exercise/collatz.py
author Santosh G. Vattam <vattam.santosh@gmail.com>
Wed, 11 Nov 2009 17:08:32 +0530
changeset 306 57291186d598
parent 64 333092b68926
child 354 5dc6c3673f9d
permissions -rw-r--r--
Updated the quiz tex files of both day 1 and day 2.

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