{"height":"190","provider_name":"Hatena Blog","description":"Problem 14 \u30b3\u30e9\u30c3\u30c4\u306f\u3001\u518d\u5e30\uff0b\u30e1\u30e2\u5316\u3067\u901f\u304f\u7f8e\u3057\u304f\u89e3\u304f\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 def Collatz(n): if n < N: if a[n] > 0: return a[n] m = n if m % 2 == 0: m /= 2 else: m = m * 3 + 1 l = Collatz(m) + 1 if n < N: a[n] = l return l N = 10 ** 6 a = [ 0 ] * N a[1] = 1 print max((Collatz(n), n) for n in xrange(1, N))[1] \u3057\u304b\u3057\u3001\u3053\u308c\u3092\u30d0\u30c3\u30c1\u30d5\u30a1\u30a4\u30eb\u3067\u3084\u308b\u3068\u975e\u5e38\u306b\u9045\u3044\u3093\u3067\u3059\u306d\u2026","image_url":null,"categories":["PE","\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0"],"url":"https://inamori.hateblo.jp/entry/20110203/p2","author_name":"inamori","blog_title":"inamori\u2019s diary","title":"\u30d0\u30c3\u30c1\u30d5\u30a1\u30a4\u30eb\u3067Project Euler\uff0836\uff09","type":"rich","author_url":"https://blog.hatena.ne.jp/inamori/","version":"1.0","blog_url":"https://inamori.hateblo.jp/","provider_url":"https://hatena.blog","published":"2011-02-03 00:00:01","width":"100%","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Finamori.hateblo.jp%2Fentry%2F20110203%2Fp2\" title=\"\u30d0\u30c3\u30c1\u30d5\u30a1\u30a4\u30eb\u3067Project Euler\uff0836\uff09 - inamori\u2019s diary\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>"}