Commits

WANG Yanjin committed 2791dd6

solve p30

Comments (0)

Files changed (1)

 p29 :: Int
 p29 = size $ Set.fromList ((^) <$> [2..100] <*> [2..100])
 
+p30 :: Int
+p30 = sum $ [x | x <- [2..(9^5*5+3^5)], isP x]
+    where
+        isP x = (sum $ map (^5) (numsOfInteger x)) == x
+
 -- solutions end
 
 
 
     args <- getArgs
     let n = read (args !! 0) :: Int
-        xxx = p29
+        xxx = p30
     print $ xxx
 
     t2 <- getCPUTime