Wednesday, 11 August 2010

#38

Incredibly simple for haskell (and quick)
module P48 where
p48 :: Integer -> String
p48 n = reverse . take 10 . reverse . show $ foldr (\x a -> a + (x^x)) 0 [1..n]
then call p48 1000.

No comments:

Post a Comment