[[ProjectEular]]

 -- Problem 30
 
 module Main (main) where
 
 import qualified Char as C (digitToInt)
 
 main :: IO ()
 main = print $ problem30
 
 problem30 :: Int
 problem30 = sum [ n | n <- [2..999999], is_sum_5powers n ]
 
 is_sum_5powers :: Int -> Bool
 is_sum_5powers n = n == (sum . map ((^5) . C.digitToInt) . show) n


トップ   差分 バックアップ リロード   一覧 単語検索 最終更新   ヘルプ   最終更新のRSS