module Problem30 where

import Data.Char

main :: IO ()
-- k*9^5 >= 10^(k-1) for k-digit number gives k = 2 to 6
main = print . sum $ filter sumPow5 [10 .. 1000000]

sumPow5 :: Int -> Bool
sumPow5 n = n == (sum . map ((^ 5) . digitToInt) . show $ n)
