{"version":"1.0","blog_url":"https://jeneshicc.hatenadiary.org/","blog_title":"\u843d\u66f8\u304d\u3001\u6642\u3005\u843d\u5b66","type":"rich","url":"https://jeneshicc.hatenadiary.org/entry/20081204/1228404740","image_url":null,"provider_name":"Hatena Blog","author_name":"jeneshicc","provider_url":"https://hatena.blog","description":"http://projecteuler.net/index.php?section=problems&id=132 \u524d\u3068\u57fa\u672c\u306f\u540c\u3058\u3002 n\u304cd\u6841\u3067\u5faa\u74b0\u3059\u308b\u306a\u3089 10^d=1 (mod n) \u3053\u308c\u3092\u5229\u7528\u3002 import Number hiding(powMod) target = 10^9 powMod a n m | n < 3 = a^n `mod` m | otherwise = let (q,r) = divMod n 2 aq = powMod a q m in aq*aq*a^r `mod` m main = print.sum.take 40 $[p| p<-drop 2 prime\u2026","author_url":"https://blog.hatena.ne.jp/jeneshicc/","width":"100%","categories":["Project Euler","Haskell"],"title":"Problem 132","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fjeneshicc.hatenadiary.org%2Fentry%2F20081204%2F1228404740\" title=\"Problem 132 - \u843d\u66f8\u304d\u3001\u6642\u3005\u843d\u5b66\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","height":"190","published":"2008-12-04 00:32:20"}