{"provider_url":"https://hatena.blog","type":"rich","provider_name":"Hatena Blog","author_name":"xef","version":"1.0","height":"190","categories":["CoffeeScript"],"html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fxef.hatenadiary.org%2Fentry%2F20120331%2Fp2\" title=\"CoffeeScript\u3067Project Euler #10 - Soleil cou coupe\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","blog_title":"Soleil cou coupe","title":"CoffeeScript\u3067Project Euler #10","author_url":"https://blog.hatena.ne.jp/xef/","description":"\u554f\u984c\u6587 Problem 10 10\u4ee5\u4e0b\u306e\u7d20\u6570\u306e\u548c\u306f2 + 3 + 5 + 7 = 17\u3067\u3042\u308b. 200\u4e07\u4ee5\u4e0b\u306e\u5168\u3066\u306e\u7d20\u6570\u306e\u548c\u3092\u8a08\u7b97\u3057\u306a\u3055\u3044. Solution \u30c0\u30fc\u30c6\u30a3\u306a\u30b3\u30fc\u30c9\u3002\u300c\u4e0a\u624b\u3044\u8a18\u8ff0\u3092\u691c\u8a0e\u3057\u307e\u3059\u300d\u3068\u306f\u306a\u3093\u3060\u3063\u305f\u306e\u304b\u3002 \u6642\u9593\u3082\u304b\u304b\u308b\u3057\u3088\u304f\u306a\u3044\u2026 is_prime ?= (n) -> [2..Math.floor(Math.sqrt(n))].every? ( (x) -> n % x != 0 ) primes = (n) -> [2,3].concat (x for x in [5..n] when is_prime? x) Array::sum = -> @.reduce (a, b\u2026","published":"2012-03-31 00:00:01","width":"100%","image_url":null,"blog_url":"https://xef.hatenadiary.org/","url":"https://xef.hatenadiary.org/entry/20120331/p2"}