2008-12-02から1日間の記事一覧

Problem 125

http://projecteuler.net/index.php?section=problems&id=125nubを忘れてハマッタ。 import Data.List isPalin x=(reverse.show)x==show x sumSquUpTo upp n = takeWhile (

Problem 124

http://projecteuler.net/index.php?section=problems&id=124 これも、そのまま。 import Number import Data.List rad = product.nub.factors p124 m= sort[(rad n,n)|n<-[1..m]] main = print.snd$p124 (10^5) !!9999

Poblem 123

http://projecteuler.net/index.php?section=problems&id=123 そのまま。 import Number import Data.List import Control.Monad main =print.liftM (+1).findIndex (>10^10). zipWith remainder primes$ [1..] where remainder p n | odd n = 2*n*p `mod` (…