summaryrefslogtreecommitdiff
path: root/day1/exercise/collatz.py
blob: 7bed9675e8af24595960ec0b4681f849fef25018 (plain)
1
2
3
4
5
6
7
8
9
10
a = int( raw_input( 'Enter number: ') )
while a != 4:
    print a
    if a % 2 == 1:
        a = a * 3 + 1
    else:
        a /= 2
print 4
print 2
print 1