Question
A googol () is a massive number: one followed by one-hundred zeros; is almost unimaginably large: one followed by two-hundred zeros. Despite their size, the sum of the digits in each number is only 1.
Considering natural numbers of the form, , where , what is the maximum digital sum?
Haskell
digits :: Integer -> [Integer]
digits 0 = []
digits n = r : digits q
where (q, r) = quotRem n 10
main :: IO ()
main = print $ maximum [sum $ digits $ a^b | a <- [1..99], b <- [1..99]]