The solution I came up with at the coffee shop (Corrected so that it’ll compile)
g :: Int -> Int -> Intg a m | m == 1 = a | m `mod` 2 == 1 = g (a + 1) (3 * m + 1) | otherwise = g (a + 1) (m `div` 2)
The solution I came up with at the coffee shop (Corrected so that it’ll compile)
g :: Int -> Int -> Intg a m | m == 1 = a | m `mod` 2 == 1 = g (a + 1) (3 * m + 1) | otherwise = g (a + 1) (m `div` 2)