{"categories":["Project Euler"],"image_url":null,"provider_url":"https://hatena.blog","version":"1.0","provider_name":"Hatena Blog","blog_url":"https://yoshitaku-jp.hatenablog.com/","title":"\u3010Project Euler\u3011Problem 20 Factorial digit sum\u3092Python\u3067\u89e3\u304f","url":"https://yoshitaku-jp.hatenablog.com/entry/2021/12/19/220000","published":"2021-12-19 22:00:00","blog_title":"\u3088\u3057\u305f\u304f blog","type":"rich","author_url":"https://blog.hatena.ne.jp/yoshitaku_jp/","author_name":"yoshitaku_jp","description":"\u3053\u306e\u554f\u984c\u3092Python\u3067\u89e3\u3044\u305f\u3002 #20 Factorial digit sum - Project Euler \u65e5\u672c\u8a9e\u306e\u554f\u984c\u6587\u306f\u3053\u3061\u3089 n \u00d7 (n - 1) \u00d7 ... \u00d7 3 \u00d7 2 \u00d7 1 \u3092 n! \u3068\u8868\u3059. \u4f8b\u3048\u3070, 10! = 10 \u00d7 9 \u00d7 ... \u00d7 3 \u00d7 2 \u00d7 1 = 3628800 \u3068\u306a\u308b. \u3053\u306e\u6570\u306e\u5404\u6841\u306e\u5408\u8a08\u306f 3 + 6 + 2 + 8 + 8 + 0 + 0 = 27 \u3067\u3042\u308b. \u3067\u306f, 100! \u306e\u5404\u4f4d\u306e\u6570\u5b57\u306e\u548c\u3092\u6c42\u3081\u3088. Problem 20 - PukiWiki import math n = 100 print(sum(map(int, str(math.\u2026","height":"190","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fyoshitaku-jp.hatenablog.com%2Fentry%2F2021%2F12%2F19%2F220000\" title=\"\u3010Project Euler\u3011Problem 20 Factorial digit sum\u3092Python\u3067\u89e3\u304f - \u3088\u3057\u305f\u304f blog\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","width":"100%"}