day1/exercise/collatz.py
changeset 64 333092b68926
child 354 5dc6c3673f9d
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/day1/exercise/collatz.py	Thu Oct 08 18:59:47 2009 +0530
@@ -0,0 +1,7 @@
+a = -1
+while a > 1:
+    print a
+    if a % 2:
+        a = a * 3 + 1
+    else:
+        a /= 2