{"published":"2012-12-16 10:54:52","url":"https://gom.hatenablog.com/entry/20121216/1355622892","width":"100%","type":"rich","blog_url":"https://gom.hatenablog.com/","author_url":"https://blog.hatena.ne.jp/gom68/","image_url":null,"blog_title":"gom68\u306e\u65e5\u8a18","title":" Project Euler - Problem 10","provider_name":"Hatena Blog","author_name":"gom68","provider_url":"https://hatena.blog","version":"1.0","height":"190","categories":["ruby"],"description":"\u3082\u308d\u3082\u308d\u306e\u5408\u9593\u306b\u3061\u3087\u3063\u3068\u3057\u305f\u4f53\u64cd\u3002http://projecteuler.net/problem=10 200\u4e07\u307e\u3067\u306e\u7d20\u6570\u306e\u5408\u8a08\u3092\u6c42\u3081\u308b\u3002 \u5358\u306b\u7d20\u6570\u30ea\u30b9\u30c8\u3092\u6c42\u3081\u3066\u5408\u8a08\u3059\u308c\u3070\u3044\u3044\u3060\u3051\u3002\u7d44\u307f\u8fbc\u307f\u30af\u30e9\u30b9\u4f7f\u3063\u3066\u3082\u3044\u3044\u3051\u3069\u3001\u81ea\u524d\u3067\u5b9f\u88c5\u3059\u308b\u3002 #!/usr/bin/env ruby class Prime def list(max) # Eratosthenes list = (3..max).step(2).to_a result = [2] while(list.last > result.last ** 2) do result << list.shift list.reject! {|n| n %\u2026","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fgom.hatenablog.com%2Fentry%2F20121216%2F1355622892\" title=\" Project Euler - Problem 10 - gom68\u306e\u65e5\u8a18\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>"}