-- Problems/Problem030.hs
module Problems.Problem030 (p30) where

import Helpers.Numbers

main = print p30

p30 :: Int
p30 = sum $ filter (\x -> x == sumOfFifthPowerDigits x) [10..999999]

sumOfFifthPowerDigits :: Int -> Int
sumOfFifthPowerDigits num = sum $ map (\x -> floor $ (fromIntegral x) ** (fromIntegral 5)) $ intToDigits num

