euler/Problem030.hs

5 lines
199 B
Haskell

-- Find the sum of all the numbers that can be written as the sum of fifth
-- powers of their digits.
import Euler
main = print $ sum $ filter (\n -> sum (map (^5) (toDigits n)) == n) [2..(6 * 9^5)]