-import "Prelude"\r
-\r
-f x = if x `mod` 2 == 0\r
- then x `div` 2\r
- else 3*x + 1\r
-fd x = unfoldr (\x -> do\r
- r = f x \r
- if x == 1\r
- then Nothing\r
- else Just (x,r)\r
- ) x\r
-\r
-//main :: [Integer] \r
-main = fd 7\r
---\r
+import "Prelude"
+
+f x = if x `mod` 2 == 0
+ then x `div` 2
+ else 3*x + 1
+fd x = unfoldr (\x -> do
+ r = f x
+ if x == 1
+ then Nothing
+ else Just (x,r)
+ ) x
+
+//main :: [Integer]
+main = fd 7
+--
[7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2]
\ No newline at end of file