module Main where import IO main = do putStrLn "Enter an integer to test the 3x+1 conjecture on:" num <- getLine threeXconject (read num) threeXconject :: Int -> Int threeXconject x | x == 1 = 1 | (x `mod` 2) == 0 = threeXconject 2*x | otherwise = threeXconject (3*x + 1)