day1/exercise/collatz.py
author Prabhu Ramachandran <prabhu@aero.iitb.ac.in>
Mon, 21 Jun 2010 03:40:59 -0400
branchscipy2010
changeset 417 caec361e3a86
parent 386 a0bec380b44f
child 425 5afcfce15e71
permissions -rw-r--r--
ENH: Added slides for FFT and basic signal processing, wherein we introduce some random number generation also. Misc. cleanup for tutorial.

a = int( raw_input( 'Enter number: ') )
while a != 4:
    print a,
    if a % 2 == 1:
        a = a * 3 + 1
    else:
        a /= 2
print 4, 2, 1