We assume that the parameter n is greater than 1.
next :: Int -> Int
next n
|n `mod` 2 == 0 = n `div` 2
|otherwise = 3*n+1