# Problem 30 – sum of all the numbers that can be written as the sum of fifth powers of their digits.

Again, as in the problem 29, there is not a big deal about the 30th Euler problem:

import Char f = sum [x | x <- [2..10^6], g x == x] where g = sum . map (^5) . map digitToInt . show main = print f

The execution time was:

real 0m2.494s

user 0m2.482s

sys 0m0.011s

Advertisements

Leave a Comment