{"id":15972,"date":"2021-12-30T05:48:13","date_gmt":"2021-12-30T05:48:13","guid":{"rendered":"https:\/\/club.informatix.co.jp\/?p=15972"},"modified":"2025-08-31T18:28:33","modified_gmt":"2025-08-31T09:28:33","slug":"python%e3%81%a7%e9%96%a2%e3%83%bb%e3%83%99%e3%83%ab%e3%83%8c%e3%83%bc%e3%82%a4%e6%95%b0%ef%bd%9cpython%e3%81%a7%e6%95%b0%e5%ad%a6%e3%82%92%e5%ad%a6%e3%81%bc%e3%81%86%ef%bc%81%e3%80%80%e7%ac%ac16","status":"publish","type":"post","link":"https:\/\/club.informatix.co.jp\/?p=15972","title":{"rendered":"Python\u3067\u95a2\u30fb\u30d9\u30eb\u30cc\u30fc\u30a4\u6570\uff5cPython\u3067\u6570\u5b66\u3092\u5b66\u307c\u3046\uff01 \u7b2c16\u56de"},"content":{"rendered":"<h2><span class=\"ez-toc-section\" id=\"%E3%81%AF%E3%81%98%E3%82%81%E3%81%AB%EF%BD%9C%E3%83%AC%E3%83%9D%E3%83%BC%E3%83%88\"><\/span>\u306f\u3058\u3081\u306b\uff5c\u30ec\u30dd\u30fc\u30c8<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<div class=\"clearfix responbox50\">\n<div class=\"lbox\">\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-15991\" src=\"https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2021\/12\/20211230-1.jpg\" alt=\"\" width=\"800\" height=\"500\" srcset=\"https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2021\/12\/20211230-1.jpg 800w, https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2021\/12\/20211230-1-300x188.jpg 300w, https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2021\/12\/20211230-1-768x480.jpg 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/p>\n<\/div>\n<div class=\"rbox\">\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-15992\" src=\"https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2021\/12\/20211230-2.jpg\" alt=\"\" width=\"800\" height=\"500\" srcset=\"https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2021\/12\/20211230-2.jpg 800w, https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2021\/12\/20211230-2-300x188.jpg 300w, https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2021\/12\/20211230-2-768x480.jpg 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/p>\n<\/div>\n<\/div>\n<p>\u79c1\u304c\u6bce\u6708\u958b\u50ac\u3057\u3066\u3044\u308b\u685c\u4e95\u9032\u306e\u7b97\u6570\u30fb\u6570\u5b66\u6559\u5ba4\uff08Zoom\u30aa\u30f3\u30e9\u30a4\u30f3\u30bb\u30df\u30ca\u30fc\uff09\u3002<\/p>\n<p>11\/21\u685c\u4e95\u9032\u306e\u9b54\u6cd5\u306e\u7b97\u6570\u6559\u5ba4\u300112\/12\u685c\u4e95\u9032\u306ePython\u30fbUNIX\u30fbMath\u6559\u5ba4\u306e\u30c6\u30fc\u30de\u306f\u305d\u308c\u305e\u308c\u300c\u5c0f\u5b66\u751f\u304b\u3089\u308f\u304b\u308b\u8d85\u5165\u9580\u95a2\u30fb\u30d9\u30eb\u30cc\u30fc\u30a4\u6570\u300d\u300c\u8d85\u5165\u9580\u30fbPython\u3067\u95a2\u30fb\u30d9\u30eb\u30cc\u30fc\u30a4\u6570\u300d\u3067\u3057\u305f\u3002<\/p>\n<p>\u5c0f\u5b66\u751f1\u5e74\u751f\u304b\u3089\u5927\u4eba\u307e\u3067\u591a\u6570\u53c2\u52a0\u3044\u305f\u3060\u304d\u76db\u6cc1\u306b\u7d42\u308f\u308a\u307e\u3057\u305f\u3002<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">\u76ee\u6b21<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-69e50dd3bb01d\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69e50dd3bb01d\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/club.informatix.co.jp\/?p=15972\/#%E3%81%AF%E3%81%98%E3%82%81%E3%81%AB%EF%BD%9C%E3%83%AC%E3%83%9D%E3%83%BC%E3%83%88\" >\u306f\u3058\u3081\u306b\uff5c\u30ec\u30dd\u30fc\u30c8<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/club.informatix.co.jp\/?p=15972\/#%E9%96%A2%E3%83%BB%E3%83%99%E3%83%AB%E3%83%8C%E3%83%BC%E3%82%A4%E6%95%B0\" >\u95a2\u30fb\u30d9\u30eb\u30cc\u30fc\u30a4\u6570<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/club.informatix.co.jp\/?p=15972\/#1712%E5%B9%B4%E3%80%8E%E6%B4%BB%E7%94%A8%E7%AE%97%E6%B3%95%E3%80%8F%E3%81%AB%E7%99%BB%E5%A0%B4%E3%81%97%E3%81%9F%E9%96%A2%E3%83%BB%E3%83%99%E3%83%AB%E3%83%8C%E3%83%BC%E3%82%A4%E6%95%B0\" >1712\u5e74\u300e\u6d3b\u7528\u7b97\u6cd5\u300f\u306b\u767b\u5834\u3057\u305f\u95a2\u30fb\u30d9\u30eb\u30cc\u30fc\u30a4\u6570<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/club.informatix.co.jp\/?p=15972\/#%E9%96%A2%E3%83%BB%E3%83%99%E3%83%AB%E3%83%8C%E3%83%BC%E3%82%A4%E6%95%B0%E3%81%AE%E6%BC%B8%E5%8C%96%E5%BC%8F\" >\u95a2\u30fb\u30d9\u30eb\u30cc\u30fc\u30a4\u6570\u306e\u6f38\u5316\u5f0f<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/club.informatix.co.jp\/?p=15972\/#%E6%BC%B8%E5%8C%96%E5%BC%8F%E3%82%92Pthon%E3%82%B3%E3%83%BC%E3%83%89%E3%81%AB%E7%BF%BB%E8%A8%B3\" >\u6f38\u5316\u5f0f\u3092Pthon\u30b3\u30fc\u30c9\u306b\u7ffb\u8a33<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/club.informatix.co.jp\/?p=15972\/#%E3%82%B3%E3%83%BC%E3%83%891%E3%80%8Cseki-bernoulli_1py%E3%80%8D\" >\u30b3\u30fc\u30c91\u300cseki-bernoulli_1.py\u300d<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/club.informatix.co.jp\/?p=15972\/#%E5%AE%9F%E8%A1%8C%E7%B5%90%E6%9E%9C\" >\u5b9f\u884c\u7d50\u679c<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/club.informatix.co.jp\/?p=15972\/#%E3%82%B3%E3%83%BC%E3%83%892%E3%80%8Cseki-bernoulli_2py%E3%80%8D\" >\u30b3\u30fc\u30c92\u300cseki-bernoulli_2.py\u300d<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/club.informatix.co.jp\/?p=15972\/#%E5%AE%9F%E8%A1%8C%E7%B5%90%E6%9E%9C-2\" >\u5b9f\u884c\u7d50\u679c<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n\n<h2><span class=\"ez-toc-section\" id=\"%E9%96%A2%E3%83%BB%E3%83%99%E3%83%AB%E3%83%8C%E3%83%BC%E3%82%A4%E6%95%B0\"><\/span>\u95a2\u30fb\u30d9\u30eb\u30cc\u30fc\u30a4\u6570<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u30bc\u30fc\u30bf\u95a2\u6570\u3092\u8a9e\u308b\u6642\u3001\u907f\u3051\u3066\u901a\u308c\u306a\u3044\u306e\u304c<a href=\"https:\/\/club.informatix.co.jp\/?p=22063\" target=\"_blank\" rel=\"noopener\">\u95a2\u30fb\u30d9\u30eb\u30cc\u30fc\u30a4\u6570<\/a>\u3067\u3059\u3002<\/p>\n<p>\u30bc\u30fc\u30bf\u306e\u8ca0\u306e\u81ea\u7136\u6570\u306b\u5bfe\u3059\u308b\u516c\u5f0f\u3092\u898b\u308c\u3070\u660e\u3089\u304b\u3067\u3059\u304c\u3001\u30bc\u30fc\u30bf\u306f\u95a2\u30fb\u30d9\u30eb\u30cc\u30fc\u30a4\u6570\u3067\u3067\u304d\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u9ad8\u6821\u6570\u5b66\u306b\u767b\u5834\u3059\u308b\u3079\u304d\u4e57\u548c\u306e\u516c\u5f0f\u306e\u4fc2\u6570\u306b\u3082\u95a2\u30fb\u30d9\u30eb\u30cc\u30fc\u30a4\u6570\u306f\u73fe\u308c\u307e\u3059\u3002\u3079\u304d\u4e57\u548c\u306e\u516c\u5f0f\u3092\u4e00\u822c\u5316\u3057\u305f\u3082\u306e\u304c\u95a2\u30fb\u30d9\u30eb\u30cc\u30fc\u30a4\u306e\u516c\u5f0f\u306b\u4ed6\u306a\u308a\u307e\u305b\u3093\u3002<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-15993\" src=\"https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2021\/12\/20211230-3.jpg\" alt=\"\" width=\"800\" height=\"500\" srcset=\"https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2021\/12\/20211230-3.jpg 800w, https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2021\/12\/20211230-3-300x188.jpg 300w, https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2021\/12\/20211230-3-768x480.jpg 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/p>\n<p>\u30af\u30e9\u30b9\u3067\u306f\u307e\u305a\u3001\u95a2\u30fb\u30d9\u30eb\u30cc\u30fc\u30a4\u6570Bn\u3092\u4f7f\u3063\u3066\u307f\u308b\u7df4\u7fd2\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<p>\u95a2\u30fb\u30d9\u30eb\u30cc\u30fc\u30a4\u6570\u81ea\u4f53\u306e\u7b97\u51fa\u306f\u5c11\u3057\u9ad8\u5ea6\u306a\u306e\u3067\u5f8c\u56de\u3057\u306b\u3057\u307e\u3059\u3002<\/p>\n<p>\u6700\u521d\u306e\u30b9\u30c6\u30c3\u30d7\u3068\u3057\u3066\u3001\u95a2\u30fb\u30d9\u30eb\u30cc\u30fc\u30a4\u6570\u306e\u6570\u8868\u306e\u6570\u5024\u3092\u7528\u3044\u3066\u3001\u3079\u304d\u4e57\u548c\u306e\u516c\u5f0f\u3092\u8a08\u7b97\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p>\u305d\u306e\u969b\u306b\u4e8c\u9805\u4fc2\u6570\uff08\u30b3\u30f3\u30d3\u30cd\u30fc\u30b7\u30e7\u30f3\uff09\u3082\u5fc5\u8981\u306b\u306a\u308b\u306e\u3067\u3001\u3042\u308f\u305b\u3066\u30d1\u30b9\u30ab\u30eb\u306e\u4e09\u89d2\u5f62\u306e\u89e3\u8aac\u3082\u884c\u3044\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-15985\" src=\"https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2021\/12\/20211230-7.jpg\" alt=\"\" width=\"800\" height=\"500\" srcset=\"https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2021\/12\/20211230-7.jpg 800w, https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2021\/12\/20211230-7-300x188.jpg 300w, https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2021\/12\/20211230-7-768x480.jpg 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-15986\" src=\"https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2021\/12\/20211230-8.jpg\" alt=\"\" width=\"800\" height=\"500\" srcset=\"https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2021\/12\/20211230-8.jpg 800w, https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2021\/12\/20211230-8-300x188.jpg 300w, https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2021\/12\/20211230-8-768x480.jpg 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/p>\n<p>\u6b21\u306e\u30b9\u30c6\u30c3\u30d7\u3068\u3057\u3066\u3001\u95a2\u30fb\u30d9\u30eb\u30cc\u30fc\u30a4\u6570\u306e\u7b97\u51fa\u306b\u9032\u3093\u3067\u3044\u304d\u307e\u3059\u3002<\/p>\n<h2><span class=\"ez-toc-section\" id=\"1712%E5%B9%B4%E3%80%8E%E6%B4%BB%E7%94%A8%E7%AE%97%E6%B3%95%E3%80%8F%E3%81%AB%E7%99%BB%E5%A0%B4%E3%81%97%E3%81%9F%E9%96%A2%E3%83%BB%E3%83%99%E3%83%AB%E3%83%8C%E3%83%BC%E3%82%A4%E6%95%B0\"><\/span>1712\u5e74\u300e\u6d3b\u7528\u7b97\u6cd5\u300f\u306b\u767b\u5834\u3057\u305f\u95a2\u30fb\u30d9\u30eb\u30cc\u30fc\u30a4\u6570<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>1712\u5e74\u3001\u308f\u304c\u56fd\u306b\u304a\u3044\u3066\u95a2\u30fb\u30d9\u30eb\u30cc\u30fc\u30a4\u6570\u306f\u4e16\u754c\u3067\u521d\u3081\u3066\u767b\u5834\u3057\u307e\u3057\u305f\u3002\u305d\u308c\u304c\u95a2\u5b5d\u548c\u306e\u6b7b\u5f8c\u306b\u5f1f\u5b50\u305f\u3061\u306b\u3088\u3063\u3066\u7de8\u7e82\u3055\u308c\u305f\u300e\u6d3b\u7528\u7b97\u6cd5\u300f\u306e\u6736\u7a4d\u8853\uff08\u3060\u305b\u304d\u3058\u3085\u3064\uff09\u3067\u3059\u3002\u6736\u3068\u306f\u5782\u308c\u3066\u3044\u308b\u3082\u306e\u3068\u3044\u3046\u610f\u5473\u3067\u3059\u3002<\/p>\n<p>\u30e4\u30b3\u30d6\u30fb\u30d9\u30eb\u30cc\u30fc\u30a4\u306e\u300e\u63a8\u6e2c\u8853\u300f\u304c\u8457\u3055\u308c\u305f\u306e\u306f\u3001\u305d\u306e1\u5e74\u5f8c\u306e1713\u5e74\u3067\u3059\u3002\u9694\u7d76\u3057\u305f\u4e16\u754c\u306e2\u5730\u70b9\u3067\u3001\u540c\u6642\u671f\u306b\u540c\u3058\u3053\u3068\u304c\u8003\u3048\u3089\u308c\u3066\u3044\u305f\u3053\u3068\u306b\u9a5a\u304f\u3070\u304b\u308a\u3067\u3059\u3002<\/p>\n<p>\u30d9\u30eb\u30cc\u30fc\u30a4\u6570Bn\u3068\u3057\u3066\u4e16\u754c\u306b\u306f\u77e5\u3089\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u304c\u3001\u4e8b\u5b9f\u306f\u95a2\u5b5d\u548c\u306e\u65b9\u304c\u51fa\u7248\u304c\u65e9\u3044\u306e\u3067\u3001\u672c\u6765\u306f\u95a2\u6570\uff08\u305b\u304d\u3059\u3046\uff09Sn\u3068\u547c\u3070\u308c\u3066\u3082\u3088\u3044\u306e\u3067\u3059\u304c\u30011\u5e74\u5dee\u3092\u8003\u616e\u3057\u3066\u95a2\u30fb\u30d9\u30eb\u30cc\u30fc\u30a4\u6570\u3068\u547c\u3076\u3079\u304d\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>\u3061\u306a\u307f\u306b\u30a6\u30a3\u30ad\u30da\u30c7\u30a3\u30a2\u306e\u30d9\u30eb\u30cc\u30fc\u30a4\u6570\u3092\u898b\u3066\u307f\u308b\u3068\u3001\u62d9\u66f8\u300e\u5929\u624d\u305f\u3061\u304c\u611b\u3057\u305f\u7f8e\u3057\u3044\u6570\u5f0f\u300f\uff08PHP\u7814\u7a76\u6240\u30012008\uff09\u3067\u3001\u30d9\u30eb\u30cc\u30fc\u30a4\u6570\u306f\u95a2\u30fb\u30d9\u30eb\u30cc\u30fc\u30a4\u6570\u3068\u547c\u3076\u3079\u304d\u3067\u3042\u308b\u3068\u66f8\u304b\u308c\u3066\u3042\u308b\u3053\u3068\u304c\u7d39\u4ecb\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-15983\" src=\"https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2021\/12\/20211230-5.jpg\" alt=\"\" width=\"800\" height=\"500\" srcset=\"https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2021\/12\/20211230-5.jpg 800w, https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2021\/12\/20211230-5-300x188.jpg 300w, https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2021\/12\/20211230-5-768x480.jpg 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E9%96%A2%E3%83%BB%E3%83%99%E3%83%AB%E3%83%8C%E3%83%BC%E3%82%A4%E6%95%B0%E3%81%AE%E6%BC%B8%E5%8C%96%E5%BC%8F\"><\/span>\u95a2\u30fb\u30d9\u30eb\u30cc\u30fc\u30a4\u6570\u306e\u6f38\u5316\u5f0f<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u95a2\u30fb\u30d9\u30eb\u30cc\u30fc\u30a4\u6570\u306f\u6b21\u306e\u3088\u3046\u306a\u5f0f\u3067\u5b9a\u7fa9\u3055\u308c\u307e\u3059\u3002\u3053\u308c\u306f\u30e4\u30b3\u30d6\u30fb\u30d9\u30eb\u30cc\u30fc\u30a4\u306b\u3088\u308b\u5b9a\u7fa9\u3067\u3059\u3002<\/p>\n<p>\u3053\u308c\u3092Python\u30b3\u30fc\u30c9\u306b\u7ffb\u8a33\u3057\u3066\u95a2\u30fb\u30d9\u30eb\u30cc\u30fc\u30a4\u6570\u3092\u7b97\u51fa\u3059\u308b\u3053\u3068\u3092\u76ee\u6307\u3057\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-15982\" src=\"https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2021\/12\/20211230-4.jpg\" alt=\"\" width=\"800\" height=\"500\" srcset=\"https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2021\/12\/20211230-4.jpg 800w, https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2021\/12\/20211230-4-300x188.jpg 300w, https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2021\/12\/20211230-4-768x480.jpg 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/p>\n<p>\u3053\u306e\u30b7\u30b0\u30de\u306e\u5f0f\u304b\u3089\u3069\u306e\u3088\u3046\u306bBn\u304c\u6c42\u307e\u3063\u3066\u3044\u304f\u304b\u3068\u3044\u3046\u3068\u3001\u307e\u305an=1\u3068\u3057\u3066B0\u304b\u3089B1\u304c\u6c42\u307e\u308a\u307e\u3059\u3002\u6b21\u306bn=2\u3068\u3057\u3066B0\u3001B1\u304b\u3089B2\u304c\u6c42\u307e\u308a\u307e\u3059\u3002<\/p>\n<p>\u6b21\u306bn=3\u3068\u3057\u3066B0\u3001B1\u3001B2\u304b\u3089B3\u304c\u6c42\u307e\u308a\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-15984\" src=\"https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2021\/12\/20211230-6.jpg\" alt=\"\" width=\"800\" height=\"500\" srcset=\"https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2021\/12\/20211230-6.jpg 800w, https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2021\/12\/20211230-6-300x188.jpg 300w, https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2021\/12\/20211230-6-768x480.jpg 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E6%BC%B8%E5%8C%96%E5%BC%8F%E3%82%92Pthon%E3%82%B3%E3%83%BC%E3%83%89%E3%81%AB%E7%BF%BB%E8%A8%B3\"><\/span>\u6f38\u5316\u5f0f\u3092Pthon\u30b3\u30fc\u30c9\u306b\u7ffb\u8a33<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u30b7\u30b0\u30de\u306e\u5f0f\u3092Bn=\u2026\u3068\u5f0f\u5909\u5f62\u3059\u308b\u3053\u3068\u3067\u3001Python\u30b3\u30fc\u30c9\u306b\u7ffb\u8a33\u3059\u308b\u3053\u3068\u3092\u8003\u3048\u307e\u3059\u3002<\/p>\n<p>\u6b21\u306e\u56f3\u306f\u305d\u306e\u8a73\u7d30\u3067\u3059\u3002\u4e00\u756a\u5f0f\u306e\u5f0f\u304cBn=\u2026\u3067\u3042\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-15987\" src=\"https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2021\/12\/20211230-9.jpg\" alt=\"\" width=\"800\" height=\"500\" srcset=\"https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2021\/12\/20211230-9.jpg 800w, https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2021\/12\/20211230-9-300x188.jpg 300w, https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2021\/12\/20211230-9-768x480.jpg 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/p>\n<p>\u3053\u306e\u5f0f\u3092\u7528\u3044\u308b\u3053\u3068\u3067\u95a2\u6570B(n)\u3092\u518d\u5e30\u7684\u5b9a\u7fa9\u3057\u307e\u3059\u3002\u305d\u306e\u8a73\u7d30\u304c\u6b21\u306e\u56f3\u3067\u3059\u3002<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-15988\" src=\"https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2021\/12\/20211230-10.jpg\" alt=\"\" width=\"800\" height=\"500\" srcset=\"https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2021\/12\/20211230-10.jpg 800w, https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2021\/12\/20211230-10-300x188.jpg 300w, https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2021\/12\/20211230-10-768x480.jpg 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E3%82%B3%E3%83%BC%E3%83%891%E3%80%8Cseki-bernoulli_1py%E3%80%8D\"><\/span>\u30b3\u30fc\u30c91\u300cseki-bernoulli_1.py\u300d<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>&gt;&gt;&gt;\u3000# seki-bernoulli_1.py<br \/>\n&gt;&gt;&gt;<br \/>\n&gt;&gt;&gt;\u3000from fractions import Fraction<br \/>\n&gt;&gt;&gt;<br \/>\n&gt;&gt;&gt;\u3000# \u4e8c\u9805\u4fc2\u6570 Combination nCk<br \/>\n&gt;&gt;&gt;\u3000def comb(n, k):<br \/>\n&gt;&gt;&gt;\u3000\u3000 prod = 1<br \/>\n&gt;&gt;&gt;\u3000\u3000 for t in range(min(k, n-k)):<br \/>\n&gt;&gt;&gt;\u3000\u3000\u3000\u00a0 prod = prod * (n-t)\/\/(t+1)<br \/>\n&gt;&gt;&gt;\u3000\u3000 return prod<br \/>\n&gt;&gt;&gt;<br \/>\n&gt;&gt;&gt;\u3000# Seki-Bernoulli number Bn<br \/>\n&gt;&gt;&gt;\u3000def B(n):<br \/>\n&gt;&gt;&gt;\u3000\u3000 if n == 0:<br \/>\n&gt;&gt;&gt;\u3000\u3000\u3000\u00a0 return 1<br \/>\n&gt;&gt;&gt;\u3000\u3000 else:<br \/>\n&gt;&gt;&gt;\u3000\u3000\u3000\u00a0 ss = 0<br \/>\n&gt;&gt;&gt;\u3000\u3000\u3000\u00a0 for k in range(0, n):<br \/>\n&gt;&gt;&gt;\u3000\u3000\u3000\u3000\u00a0 \u00a0ss = ss + ((-1)**k) * comb(n+1, k)*B(k)<br \/>\n&gt;&gt;&gt;\u3000\u3000\u3000\u00a0 return Fraction((-1)**(n+1), n+1) * ss<br \/>\n&gt;&gt;&gt;<br \/>\n&gt;&gt;&gt;<br \/>\n&gt;&gt;&gt;\u3000n = int(input(&#8216;B(n)\u306en\u306e\u4e0a\u9650 &gt;&gt;&gt; &#8216;))<br \/>\n&gt;&gt;&gt;\u3000import sympy<br \/>\n&gt;&gt;&gt;\u3000for i in range(n + 1):<br \/>\n&gt;&gt;&gt;\u3000\u3000 print(f&#8221;B({i})= {B(i)}&#8221;.ljust(20, &#8221; &#8220;),f&#8221;sympy.bernoulli({i})=&#8221;,sympy.bernoulli(i))<\/p>\n<p>\u3053\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u30d5\u30a1\u30a4\u30eb\u306f\u6b21\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3067\u304d\u307e\u3059<br \/>\n<a href=\"https:\/\/drive.google.com\/file\/d\/1oI8u6PutBn5zow9g6Q0ifpf7U8X2GXl0\/view?usp=sharing\" target=\"_blank\" rel=\"noopener\">https:\/\/drive.google.com\/file\/d\/1oI8u6PutBn5zow9g6Q0ifpf7U8X2GXl0\/view?usp=sharing<\/a><\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E5%AE%9F%E8%A1%8C%E7%B5%90%E6%9E%9C\"><\/span>\u5b9f\u884c\u7d50\u679c<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>python seki-bernoulli_1.py<br \/>\n\u3068\u3057\u3066\u5b9f\u884c\u3055\u305b\u308b\u3068\u3001<br \/>\nB(n)\u306en\u306e\u4e0a\u9650\u304c\u305f\u305a\u306d\u3089\u308c\u307e\u3059\u3002<\/p>\n<p>20\u3068\u3057\u3066\u307f\u305f\u306e\u304c\u6b21\u306e\u7d50\u679c\u3067\u3059\u3002<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-15989\" src=\"https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2021\/12\/20211230-11.jpg\" alt=\"\" width=\"626\" height=\"532\" srcset=\"https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2021\/12\/20211230-11.jpg 626w, https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2021\/12\/20211230-11-300x255.jpg 300w\" sizes=\"(max-width: 626px) 100vw, 626px\" \/><\/p>\n<p>SymPy\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3057\u3066sympy.bernoulli(n)\u3068\u3059\u308c\u3070n\u756a\u76ee\u306e\u95a2\u30fb\u30d9\u30eb\u30cc\u30fc\u30a4\u6570\u3092\u8fd4\u3057\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n<p>\u305d\u3053\u3067B(n)\u306b\u5bfe\u3057\u3066sympy.bernoulli(n)\u3082\u8868\u793a\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>B(1)= 1\/2 \u3067\u3042\u308b\u306e\u306b\u5bfe\u3057\u3066sympy.bernoulli(2)= -1\/2\u3067\u3059\u3002<\/p>\n<p>\u3053\u308c\u306f\u3001\u30e4\u30b3\u30d6\u30fb\u30d9\u30eb\u30cc\u30fc\u30a4\u306b\u3088\u308b\u30aa\u30ea\u30b8\u30ca\u30eb\u306a\u95a2\u30fb\u30d9\u30eb\u30cc\u30fc\u30a4\u6570\u306e\u5b9a\u7fa9\u304cB(1)= 1\/2\u3067\u3042\u308b\u306e\u306b\u5bfe\u3057\u3066\u3001\u73fe\u5728\u306e\u95a2\u30fb\u30d9\u30eb\u30cc\u30fc\u30a4\u6570\u306f\u6307\u6570\u95a2\u6570\u3092\u7528\u3044\u305f\u95a2\u6570\u3092<a href=\"https:\/\/club.informatix.co.jp\/?p=2448\" target=\"_blank\" rel=\"noopener\">\u30de\u30af\u30ed\u30fc\u30ea\u30f3\u5c55\u958b<\/a>\u3057\u305f\u3068\u304d\u306e\u5c55\u958b\u4fc2\u6570\u3068\u3057\u3066\u5b9a\u7fa9\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u305d\u308c\u304csympy.bernoulli()\u3067\u3059\u3002<\/p>\n<p>\u6b74\u53f2\u7684\u306b\u3053\u306e2\u3064\u306e\u5b9a\u7fa9\u304c\u6df7\u5728\u3057\u3066\u3044\u307e\u3059\u3002\u4e00\u756a\u76ee\u306e\u95a2\u30fb\u30d9\u30eb\u30cc\u30fc\u30a4\u6570\u3060\u3051\u306e\u9055\u3044\u3067\u3059\u304c\u3001\u95a2\u30fb\u30d9\u30eb\u30cc\u30fc\u30a4\u6570\u3092\u6271\u3046\u5834\u5408\u306b\u306f\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<p>\u3053\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u306b\u3088\u308b\u95a2\u30fb\u30d9\u30eb\u30cc\u30fc\u30a4\u6570\u306e\u7b97\u51fa\u306fn=22\u304c\u9650\u754c\u3067\u3059\u3002\u518d\u5e30\u7684\u5b9a\u7fa9\u304c\u539f\u56e0\u3067\u3059\u3002<\/p>\n<p>\u3053\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u306f\u30e4\u30b3\u30d6\u30fb\u30d9\u30eb\u30cc\u30fc\u30a4\u306b\u3088\u308b\u5b9a\u7fa9\u3092\u5fe0\u5b9f\u306b\u7ffb\u8a33\u3057\u3066\u307f\u305f\u3082\u306e\u3067\u3059\u3002<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E3%82%B3%E3%83%BC%E3%83%892%E3%80%8Cseki-bernoulli_2py%E3%80%8D\"><\/span>\u30b3\u30fc\u30c92\u300cseki-bernoulli_2.py\u300d<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>&gt;&gt;&gt;\u3000# seki-bernoulli_2.py<br \/>\n&gt;&gt;&gt;<br \/>\n&gt;&gt;&gt;\u3000print(&#8216;zeta fuction algorithm&#8217;)<br \/>\n&gt;&gt;&gt;\u3000n = int(input(&#8216;B(n)\u306en\u306e\u4e0a\u9650 &gt;&gt;&gt; &#8216;))<br \/>\n&gt;&gt;&gt;<br \/>\n&gt;&gt;&gt;\u3000from mpmath import zeta<br \/>\n&gt;&gt;&gt;\u3000def B(m):<br \/>\n&gt;&gt;&gt;\u3000\u00a0 \u00a0 b = -m * zeta(1-m)<br \/>\n&gt;&gt;&gt;\u3000\u00a0 \u00a0 return b<br \/>\n&gt;&gt;&gt;<br \/>\n&gt;&gt;&gt;\u3000from sympy import *<br \/>\n&gt;&gt;&gt;\u3000for i in range(1, n + 1):<br \/>\n&gt;&gt;&gt;\u3000\u00a0 \u00a0 \u00a0b = B(i)<br \/>\n&gt;&gt;&gt;\u3000\u00a0 \u00a0 \u00a0c = Rational(b)<br \/>\n&gt;&gt;&gt;\u3000\u00a0 \u00a0 \u00a0print(f&#8221;B({i})= {c}&#8221;.ljust(20, &#8221; &#8220;),f&#8221;sympy.bernoulli({i})=&#8221;,bernoulli(i))<\/p>\n<p>\u3053\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u30d5\u30a1\u30a4\u30eb\u306f\u6b21\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3067\u304d\u307e\u3059<br \/>\n<a href=\"https:\/\/drive.google.com\/file\/d\/1PhkgXMSbvc5BoMuKgLgK6FLiJNjcvRg-\/view?usp=sharing\" target=\"_blank\" rel=\"noopener\">https:\/\/drive.google.com\/file\/d\/1PhkgXMSbvc5BoMuKgLgK6FLiJNjcvRg-\/view?usp=sharing<\/a><\/p>\n<p>\u95a2\u30fb\u30d9\u30eb\u30cc\u30fc\u30a4\u6570\u3068\u30bc\u30fc\u30bf\u95a2\u6570\u306e\u95a2\u4fc2\u304b\u3089\u95a2\u30fb\u30d9\u30eb\u30cc\u30fc\u30a4\u6570\u3092\u6c42\u3081\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u3059\u3002<\/p>\n<p>\u305d\u306e\u95a2\u4fc2\u5f0f\u306f\u3044\u305f\u3063\u3066\u30b7\u30f3\u30d7\u30eb\u3067\u3059\u3002<br \/>\nBm\u3000= &#8211; m * zeta(1-m)<\/p>\n<p>\u30bc\u30fc\u30bf\u95a2\u6570\u306fmpmath\u30e9\u30a4\u30d6\u30e9\u30ea\u306b\u3042\u308b\u95a2\u6570zeta()\u3092\u7528\u3044\u3066\u3044\u307e\u3059\u3002<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E5%AE%9F%E8%A1%8C%E7%B5%90%E6%9E%9C-2\"><\/span>\u5b9f\u884c\u7d50\u679c<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-15990\" src=\"https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2021\/12\/20211230-12.jpg\" alt=\"\" width=\"626\" height=\"532\" srcset=\"https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2021\/12\/20211230-12.jpg 626w, https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2021\/12\/20211230-12-300x255.jpg 300w\" sizes=\"(max-width: 626px) 100vw, 626px\" \/><\/p>\n<p>B(1)= 1\/2\u3067\u3042\u308b\u3053\u3068\u304b\u3089\u3001\u95a2\u4fc2\u5f0fBm\u3000= &#8211; m * zeta(1-m)\u306e\u95a2\u30fb\u30d9\u30eb\u30cc\u30fc\u30a4\u6570\u306f\u30e4\u30b3\u30d6\u30fb\u30d9\u30eb\u30cc\u30fc\u30a4\u306e\u5b9a\u7fa9\u306b\u3088\u308b\u3082\u306e\u3060\u3068\u308f\u304b\u308a\u307e\u3059\u3002<\/p>\n<p>\u305d\u3082\u305d\u3082\u95a2\u30fb\u30d9\u30eb\u30cc\u30fc\u30a4\u6570\u3092\u8a08\u7b97\u3059\u308b\u7c21\u5358\u306a\u516c\u5f0f\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u3053\u308c\u307e\u3067\u306b\u95a2\u30fb\u30d9\u30eb\u30cc\u30fc\u30a4\u6570\u3092\u7b97\u51fa\u3059\u308b\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306f\u3044\u304f\u3064\u3082\u8003\u6848\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u8208\u5473\u3092\u6301\u3063\u305f\u65b9\u306f\u305d\u308c\u3089\u306e\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u306b\u30c1\u30e3\u30ec\u30f3\u30b8\u3057\u3066\u307f\u3066\u306f\u3044\u304b\u304c\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u306f\u3058\u3081\u306b\uff5c\u30ec\u30dd\u30fc\u30c8 \u79c1\u304c\u6bce\u6708\u958b\u50ac\u3057\u3066\u3044\u308b\u685c\u4e95\u9032\u306e\u7b97\u6570\u30fb\u6570\u5b66\u6559\u5ba4\uff08Zoom\u30aa\u30f3\u30e9\u30a4\u30f3\u30bb\u30df\u30ca\u30fc\uff09\u3002 11\/21\u685c\u4e95\u9032\u306e\u9b54\u6cd5\u306e\u7b97\u6570\u6559\u5ba4\u300112\/12\u685c\u4e95\u9032\u306ePython\u30fbUNIX\u30fbMath\u6559\u5ba4\u306e\u30c6\u30fc\u30de\u306f\u305d\u308c\u305e &#8230; <\/p>\n","protected":false},"author":4,"featured_media":15984,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,464,526],"tags":[65,788],"class_list":["post-15972","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-4","category-hito-star-mathmatics","category-526","tag-python","tag-788"],"jetpack_featured_media_url":"https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2021\/12\/20211230-6.jpg","_links":{"self":[{"href":"https:\/\/club.informatix.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/15972","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/club.informatix.co.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/club.informatix.co.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/club.informatix.co.jp\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/club.informatix.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=15972"}],"version-history":[{"count":14,"href":"https:\/\/club.informatix.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/15972\/revisions"}],"predecessor-version":[{"id":22441,"href":"https:\/\/club.informatix.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/15972\/revisions\/22441"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/club.informatix.co.jp\/index.php?rest_route=\/wp\/v2\/media\/15984"}],"wp:attachment":[{"href":"https:\/\/club.informatix.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=15972"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/club.informatix.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=15972"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/club.informatix.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=15972"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}