[{"id":247536,"date":"2026-08-04T08:18:58","date_gmt":"2026-08-04T13:18:58","guid":{"rendered":"https:\/\/www.johndcook.com\/blog\/?p=247536"},"modified":"2026-08-04T08:18:58","modified_gmt":"2026-08-04T13:18:58","slug":"metallic-alchemy","status":"publish","type":"post","link":"https:\/\/www.johndcook.com\/blog\/2026\/08\/04\/metallic-alchemy\/","title":{"rendered":"Metallic alchemy"},"content":{"rendered":"<p>After writing the <a href=\"https:\/\/www.johndcook.com\/blog\/2026\/08\/04\/ratio-of-metallic-ratios\/\">previous post<\/a> about metallic ratios, I thought about the analogy to alchemy and the attempt to make precious metals out of base metals.<\/p>\n<p>When can you make one metallic ratio out of another? Can you make the golden ratio out of the lead ratio?<\/p>\n<p>Before we can make gold out of lead, we have to say what lead is.<\/p>\n<h2>Defining metallic ratios<\/h2>\n<p>The metallic ratios\u00a0<em>M<\/em>(<em>n<\/em>) can be defined several ways. The most interesting definition is the number whose continued fraction representation contains all <em>n<\/em>s. A more prosaic but more convenient definition is the larger number that equals its reciprocal plus <em>n<\/em>, which can be found using the quadratic formula.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" style=\"background-color: white;\" src=\"https:\/\/www.johndcook.com\/metallic_ratio_def.svg\" alt=\"M(n) = n + \\cfrac{1}{n+\\cfrac{1}{n+\\cfrac{1}{n+\\cdots}}} = \\frac{n + \\sqrt{n^2 + 4}}{2}\" width=\"344\" height=\"110\" \/><\/p>\n<p>The golden ratio is\u00a0<em>M<\/em>(1), the silver ratio is\u00a0<em>M<\/em>(2), and the bronze ratio is\u00a0<em>M<\/em>(3).<\/p>\n<h2>Gold from silver and bronze?<\/h2>\n<p>Can you make the golden ratio out of the silver and bronze ratios? Not by integer arithmetic. The golden ratio involves \u221a5, the silver ratio \u221a2 and the bronze ratio \u221a13. No integer operations on the latter two radicals will produce the former, though you can come arbitrarily close.<\/p>\n<h2>Gold from lead<\/h2>\n<p>The metallic ratios for <em>n<\/em> &gt; 3 don&#8217;t have standard names, but let&#8217;s call <em>M<\/em>(4) the lead ratio. Can you make the golden ratio out of the lead ratio? Yes you can:<\/p>\n<p style=\"padding-left: 40px;\"><em>M<\/em>(1) = (<em>M<\/em>(4) \u2212 1)\/2.<\/p>\n<h2>General solution<\/h2>\n<p>In general, when can you make\u00a0<em>M<\/em>(<em>n<\/em>) out of\u00a0<em>M<\/em>(<em>m<\/em>)? In abstract terms the question is when the fields<\/p>\n<p style=\"padding-left: 40px;\">\u211a(\u221a(<em>n<\/em>\u00b2 + 4))<\/p>\n<p>and<\/p>\n<p style=\"padding-left: 40px;\">\u211a(\u221a(<em>m<\/em>\u00b2 + 4))<\/p>\n<p>are the same, i.e. when adjoining \u221a(<em>n<\/em>\u00b2 + 4) to the rational numbers gives the same field as adjoining \u221a(<em>m<\/em>\u00b2 + 4) to the rational numbers. This occurs if and only if<\/p>\n<p style=\"padding-left: 40px;\">(<em>n<\/em>\u00b2 + 4)\/(<em>m\u00b2<\/em> + 4)<\/p>\n<p>is the square of a rational number.<\/p>\n<h2>Bronze from copper and tin<\/h2>\n<p>Can you make bronze out of copper and tin? Yes, if you define\u00a0<em>M<\/em>(36) to be the copper ratio and\u00a0<em>M<\/em>(393) to be the tin ratio, because<\/p>\n<p style=\"padding-left: 40px;\">(3\u00b2 + 4)\/(36\u00b2 + 4) = (1\/10)\u00b2<\/p>\n<p>and<\/p>\n<p style=\"padding-left: 40px;\">(3\u00b2 + 4)\/(292\u00b2 + 4) = (1\/109)\u00b2.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>After writing the previous post about metallic ratios, I thought about the analogy to alchemy and the attempt to make precious metals out of base metals. When can you make one metallic ratio out of another? Can you make the golden ratio out of the lead ratio? Before we can make gold out of lead, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[9],"tags":[94],"class_list":["post-247536","post","type-post","status-publish","format-standard","hentry","category-math","tag-number-theory"],"acf":[],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"By analogy with alchemy, can you make gold from lead? i.e. can you make the golden ratio by integer operations on the lead ratio?\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"John\"\/>\n\t<meta name=\"keywords\" content=\"number theory\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.johndcook.com\/blog\/2026\/08\/04\/metallic-alchemy\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"John D. Cook | Applied Mathematics Consulting\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Metallic alchemy: making one metallic ratio from another\" \/>\n\t\t<meta property=\"og:description\" content=\"By analogy with alchemy, can you make gold from lead? i.e. can you make the golden ratio by integer operations on the lead ratio?\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.johndcook.com\/blog\/2026\/08\/04\/metallic-alchemy\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2026-08-04T13:18:58+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2026-08-04T13:18:58+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Metallic alchemy: making one metallic ratio from another\" \/>\n\t\t<meta name=\"twitter:description\" content=\"By analogy with alchemy, can you make gold from lead? i.e. can you make the golden ratio by integer operations on the lead ratio?\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Metallic alchemy: making one metallic ratio from another","description":"By analogy with alchemy, can you make gold from lead? i.e. can you make the golden ratio by integer operations on the lead ratio?","canonical_url":"https:\/\/www.johndcook.com\/blog\/2026\/08\/04\/metallic-alchemy\/","robots":"max-image-preview:large","keywords":"number theory","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"John D. Cook | Applied Mathematics Consulting","og:type":"article","og:title":"Metallic alchemy: making one metallic ratio from another","og:description":"By analogy with alchemy, can you make gold from lead? i.e. can you make the golden ratio by integer operations on the lead ratio?","og:url":"https:\/\/www.johndcook.com\/blog\/2026\/08\/04\/metallic-alchemy\/","article:published_time":"2026-08-04T13:18:58+00:00","article:modified_time":"2026-08-04T13:18:58+00:00","twitter:card":"summary","twitter:title":"Metallic alchemy: making one metallic ratio from another","twitter:description":"By analogy with alchemy, can you make gold from lead? i.e. can you make the golden ratio by integer operations on the lead ratio?","twitter:image":"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png"},"aioseo_meta_data":{"post_id":"247536","title":"Metallic alchemy: making one metallic ratio from another","description":"By analogy with alchemy, can you make gold from lead? i.e. can you make the golden ratio by integer operations on the lead ratio?","keywords":null,"keyphrases":{"focus":{"keyphrase":"","score":0,"analysis":{"keyphraseInTitle":{"score":0,"maxScore":9,"error":1}}},"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"created":"2026-08-04 12:23:52","updated":"2026-08-04 18:09:02","ai":{"faqs":[],"keyPoints":[],"schemas":[],"titles":[],"descriptions":[],"socialPosts":{"email":{"subject":"","preview":"","content":""},"linkedin":[],"twitter":[],"facebook":[],"instagram":[]}},"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.johndcook.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.johndcook.com\/blog\/category\/math\/\" title=\"Math\">Math<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tMetallic alchemy\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.johndcook.com\/blog"},{"label":"Math","link":"https:\/\/www.johndcook.com\/blog\/category\/math\/"},{"label":"Metallic alchemy","link":"https:\/\/www.johndcook.com\/blog\/2026\/08\/04\/metallic-alchemy\/"}],"_links":{"self":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247536","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/comments?post=247536"}],"version-history":[{"count":2,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247536\/revisions"}],"predecessor-version":[{"id":247538,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247536\/revisions\/247538"}],"wp:attachment":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/media?parent=247536"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/categories?post=247536"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/tags?post=247536"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":247532,"date":"2026-08-04T06:41:49","date_gmt":"2026-08-04T11:41:49","guid":{"rendered":"https:\/\/www.johndcook.com\/blog\/?p=247532"},"modified":"2026-08-04T06:41:49","modified_gmt":"2026-08-04T11:41:49","slug":"ratio-of-metallic-ratios","status":"publish","type":"post","link":"https:\/\/www.johndcook.com\/blog\/2026\/08\/04\/ratio-of-metallic-ratios\/","title":{"rendered":"Ratio of metallic ratios"},"content":{"rendered":"<p>The golden ratio is the first and best known of the metallic ratios. I&#8217;ve written about the silver ratio a few times, most recently <a href=\"https:\/\/www.johndcook.com\/blog\/2026\/06\/30\/silver-kings\/\">here<\/a>. And I&#8217;ve mentioned the <a href=\"https:\/\/www.johndcook.com\/blog\/2023\/04\/14\/metallic-ratios\/\">bronze ratio<\/a> a couple times. The metallic ratios after bronze don&#8217;t have standard names.<\/p>\n<p>The <em>n<\/em>th metallic ratio <em>M<\/em>(<em>n<\/em>) is the number whose continued fraction representation contains all <em>n<\/em>s.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium\" src=\"https:\/\/www.johndcook.com\/metallic_ratio.svg\" alt=\"n + \\cfrac{1}{n+\\cfrac{1}{n+\\cfrac{1}{n+\\cdots}}} = \\frac{n + \\sqrt{n^2 + 4}}{2}\" width=\"276\" height=\"95\" \/><\/p>\n<p>When <em>n<\/em> = 1, 2, and 3 we get the gold, silver, and bronze ratios.<\/p>\n<p>You can approximate any positive real number as a ratio of metallic ratios. To see this, note that for large\u00a0<em>n<\/em>, <i>M<\/i>(<em>n<\/em>)\u00a0is approximately\u00a0<em>n<\/em>. For any positive rational number <em>a<\/em>\/<em>b<\/em>,<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" style=\"background-color: white;\" src=\"https:\/\/www.johndcook.com\/metallic_ratio_ratio.svg\" alt=\"\\lim_{n\\to\\infty} \\frac{M(na)}{M(nb)} = \\frac{a}{b}\" width=\"131\" height=\"45\" \/><\/p>\n<p>and so you can make\u00a0<em>M<\/em>(<em>na<\/em>) \/\u00a0<em>M<\/em>(<em>nb<\/em>) as close to\u00a0<em>a<\/em>\/<em>b<\/em> as you like by taking\u00a0<em>n<\/em> large enough. And since the rationals are dense in the reals, you can approximate any positive real number as close as you&#8217;d like.<\/p>\n<p>Let&#8217;s look for metallic ratios whose ratios approximate \u03c0 to within 0.001 with the following Python code.<\/p>\n<pre>from math import pi, sqrt\r\n\r\nM = lambda n: 0.5*(n + sqrt(n**2 + 4))\r\n\r\nfor n in range(1, 100):\r\n    a = round(pi*n)\r\n    b = n\r\n    r = M(a)\/M(b)\r\n    if abs(r - pi) &lt; 0.001:\r\n        print(a, b, r)\r\n<\/pre>\n<p>This shows<\/p>\n<p style=\"padding-left: 40px;\">\u03c0 \u2248\u00a0<em>M<\/em>(132) \/\u00a0<em>M<\/em>(42) = 3.1412\u2026<\/p>\n<p>Could we find smaller numbers that work? The following code shows the answer is no.<\/p>\n<pre>k = 132 + 42\r\n# loop over numbers whose sum is less than k\r\nfor n in range(1, k):\r\n    for a in range(1, n):\r\n        b = n - a\r\n        r = M(a)\/M(b)\r\n        if abs(r - pi) &lt; 0.001:\r\n            print(a, b, r)\r\n            exit()\r\n<\/pre>\n<h2>Related posts<\/h2>\n<ul>\n<li class='link'><a href='https:\/\/www.johndcook.com\/blog\/2024\/09\/01\/pell-numbers\/'>Pell is to silver as Fibonacci is to gold<\/a><\/li>\n<li class='link'><a href='https:\/\/www.johndcook.com\/blog\/2024\/10\/10\/golden-ellipse\/'>Golden ellipse<\/a><\/li>\n<li class='link'><a href='https:\/\/www.johndcook.com\/blog\/2026\/06\/29\/derivative-equals-inverse\/'>Derivative equals inverse<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>The golden ratio is the first and best known of the metallic ratios. I&#8217;ve written about the silver ratio a few times, most recently here. And I&#8217;ve mentioned the bronze ratio a couple times. The metallic ratios after bronze don&#8217;t have standard names. The nth metallic ratio M(n) is the number whose continued fraction representation [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[9],"tags":[],"class_list":["post-247532","post","type-post","status-publish","format-standard","hentry","category-math"],"acf":[],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"The golden ratio is the first and best known of the metallic ratios. I&#039;ve written about the silver ratio a few times, most recently here. And I&#039;ve mentioned the bronze ratio a couple times. The metallic ratios after bronze don&#039;t have standard names. The nth metallic ratio M(n) is the number whose continued fraction representation\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"John\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.johndcook.com\/blog\/2026\/08\/04\/ratio-of-metallic-ratios\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"John D. Cook | Applied Mathematics Consulting\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Ratio of metallic ratios\" \/>\n\t\t<meta property=\"og:description\" content=\"The golden ratio is the first and best known of the metallic ratios. I&#039;ve written about the silver ratio a few times, most recently here. And I&#039;ve mentioned the bronze ratio a couple times. The metallic ratios after bronze don&#039;t have standard names. The nth metallic ratio M(n) is the number whose continued fraction representation\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.johndcook.com\/blog\/2026\/08\/04\/ratio-of-metallic-ratios\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2026-08-04T11:41:49+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2026-08-04T11:41:49+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Ratio of metallic ratios\" \/>\n\t\t<meta name=\"twitter:description\" content=\"The golden ratio is the first and best known of the metallic ratios. I&#039;ve written about the silver ratio a few times, most recently here. And I&#039;ve mentioned the bronze ratio a couple times. The metallic ratios after bronze don&#039;t have standard names. The nth metallic ratio M(n) is the number whose continued fraction representation\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Ratio of metallic ratios","description":"The golden ratio is the first and best known of the metallic ratios. I've written about the silver ratio a few times, most recently here. And I've mentioned the bronze ratio a couple times. The metallic ratios after bronze don't have standard names. The nth metallic ratio M(n) is the number whose continued fraction representation","canonical_url":"https:\/\/www.johndcook.com\/blog\/2026\/08\/04\/ratio-of-metallic-ratios\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"John D. Cook | Applied Mathematics Consulting","og:type":"article","og:title":"Ratio of metallic ratios","og:description":"The golden ratio is the first and best known of the metallic ratios. I've written about the silver ratio a few times, most recently here. And I've mentioned the bronze ratio a couple times. The metallic ratios after bronze don't have standard names. The nth metallic ratio M(n) is the number whose continued fraction representation","og:url":"https:\/\/www.johndcook.com\/blog\/2026\/08\/04\/ratio-of-metallic-ratios\/","article:published_time":"2026-08-04T11:41:49+00:00","article:modified_time":"2026-08-04T11:41:49+00:00","twitter:card":"summary","twitter:title":"Ratio of metallic ratios","twitter:description":"The golden ratio is the first and best known of the metallic ratios. I've written about the silver ratio a few times, most recently here. And I've mentioned the bronze ratio a couple times. The metallic ratios after bronze don't have standard names. The nth metallic ratio M(n) is the number whose continued fraction representation","twitter:image":"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png"},"aioseo_meta_data":{"post_id":"247532","title":null,"description":null,"keywords":null,"keyphrases":{"focus":[],"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"created":"2026-08-04 10:51:59","updated":"2026-08-04 12:24:03","ai":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.johndcook.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.johndcook.com\/blog\/category\/math\/\" title=\"Math\">Math<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tRatio of metallic ratios\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.johndcook.com\/blog"},{"label":"Math","link":"https:\/\/www.johndcook.com\/blog\/category\/math\/"},{"label":"Ratio of metallic ratios","link":"https:\/\/www.johndcook.com\/blog\/2026\/08\/04\/ratio-of-metallic-ratios\/"}],"_links":{"self":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247532","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/comments?post=247532"}],"version-history":[{"count":1,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247532\/revisions"}],"predecessor-version":[{"id":247535,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247532\/revisions\/247535"}],"wp:attachment":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/media?parent=247532"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/categories?post=247532"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/tags?post=247532"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":247524,"date":"2026-08-02T15:47:53","date_gmt":"2026-08-02T20:47:53","guid":{"rendered":"https:\/\/www.johndcook.com\/blog\/?p=247524"},"modified":"2026-08-04T04:57:39","modified_gmt":"2026-08-04T09:57:39","slug":"holonomic-functions","status":"publish","type":"post","link":"https:\/\/www.johndcook.com\/blog\/2026\/08\/02\/holonomic-functions\/","title":{"rendered":"Holonomic functions"},"content":{"rendered":"<p><a href=\"https:\/\/www.johndcook.com\/blog\/2026\/08\/01\/why-polynomial-coefficients\/\">Yesterday<\/a> I wrote that a lot of the special functions that pop up in mathematical physics are solutions to second order linear differential equations with polynomial coefficients. More generally,<strong> holonomic functions<\/strong> are defined to be those functions that are the solutions to linear differential equations, of any order, with polynomial coefficients.<\/p>\n<p>Most special functions are holonomic. To quantify that statement, I went through the special functions covered in Abramowitz and Stegun. The large majority are holonomic, though some common functions like the gamma function are not holonomic.<\/p>\n<p><a href=\"https:\/\/www.johndcook.com\/holonomic_odes_abramowitz_stegun.pdf\">This report<\/a> goes through the functions in A&amp;S. For those that are holonomic, it gives the differential equation that the function solves. The large majority of these equations are second order, but not all. And the coefficients are nearly always first or second order polynomials, rarely higher order.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Yesterday I wrote that a lot of the special functions that pop up in mathematical physics are solutions to second order linear differential equations with polynomial coefficients. More generally, holonomic functions are defined to be those functions that are the solutions to linear differential equations, of any order, with polynomial coefficients. Most special functions are [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[9],"tags":[47,129],"class_list":["post-247524","post","type-post","status-publish","format-standard","hentry","category-math","tag-differential-equations","tag-special-functions"],"acf":[],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"Most special functions are holonomic, meaning that they can be defined by linear differential equations with polynomial coefficients.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"John\"\/>\n\t<meta name=\"keywords\" content=\"differential equations,special functions\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.johndcook.com\/blog\/2026\/08\/02\/holonomic-functions\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"John D. Cook | Applied Mathematics Consulting\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Holonomic functions\" \/>\n\t\t<meta property=\"og:description\" content=\"Most special functions are holonomic, meaning that they can be defined by linear differential equations with polynomial coefficients.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.johndcook.com\/blog\/2026\/08\/02\/holonomic-functions\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2026-08-02T20:47:53+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2026-08-04T09:57:39+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Holonomic functions\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Most special functions are holonomic, meaning that they can be defined by linear differential equations with polynomial coefficients.\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Holonomic functions","description":"Most special functions are holonomic, meaning that they can be defined by linear differential equations with polynomial coefficients.","canonical_url":"https:\/\/www.johndcook.com\/blog\/2026\/08\/02\/holonomic-functions\/","robots":"max-image-preview:large","keywords":"differential equations,special functions","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"John D. Cook | Applied Mathematics Consulting","og:type":"article","og:title":"Holonomic functions","og:description":"Most special functions are holonomic, meaning that they can be defined by linear differential equations with polynomial coefficients.","og:url":"https:\/\/www.johndcook.com\/blog\/2026\/08\/02\/holonomic-functions\/","article:published_time":"2026-08-02T20:47:53+00:00","article:modified_time":"2026-08-04T09:57:39+00:00","twitter:card":"summary","twitter:title":"Holonomic functions","twitter:description":"Most special functions are holonomic, meaning that they can be defined by linear differential equations with polynomial coefficients.","twitter:image":"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png"},"aioseo_meta_data":{"post_id":"247524","title":null,"description":"Most special functions are holonomic, meaning that they can be defined by linear differential equations with polynomial coefficients.","keywords":null,"keyphrases":{"focus":[],"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"created":"2026-08-02 20:34:46","updated":"2026-08-04 10:52:40","ai":{"faqs":[],"keyPoints":[],"schemas":[],"titles":[],"descriptions":[],"socialPosts":{"email":{"subject":"","preview":"","content":""},"linkedin":[],"twitter":[],"facebook":[],"instagram":[]}},"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.johndcook.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.johndcook.com\/blog\/category\/math\/\" title=\"Math\">Math<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tHolonomic functions\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.johndcook.com\/blog"},{"label":"Math","link":"https:\/\/www.johndcook.com\/blog\/category\/math\/"},{"label":"Holonomic functions","link":"https:\/\/www.johndcook.com\/blog\/2026\/08\/02\/holonomic-functions\/"}],"_links":{"self":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247524","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/comments?post=247524"}],"version-history":[{"count":2,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247524\/revisions"}],"predecessor-version":[{"id":247531,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247524\/revisions\/247531"}],"wp:attachment":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/media?parent=247524"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/categories?post=247524"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/tags?post=247524"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":247518,"date":"2026-08-02T12:57:31","date_gmt":"2026-08-02T17:57:31","guid":{"rendered":"https:\/\/www.johndcook.com\/blog\/?p=247518"},"modified":"2026-08-02T19:20:01","modified_gmt":"2026-08-03T00:20:01","slug":"estimating-a-cumulative-sum","status":"publish","type":"post","link":"https:\/\/www.johndcook.com\/blog\/2026\/08\/02\/estimating-a-cumulative-sum\/","title":{"rendered":"Estimating a cumulative sum"},"content":{"rendered":"<p>In <a href=\"https:\/\/www.johndcook.com\/blog\/2026\/08\/01\/counting-rooted-trees\/\">this post<\/a> I mentioned two series which I denoted\u00a0<em>t<\/em>(<em>n<\/em>) and\u00a0<em>c<\/em>(<em>n<\/em>). The former is the number of unlabeled rooted trees with\u00a0<em>n<\/em> nodes. The latter is the cumulative sum of the former, i.e.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" style=\"background-color: white;\" src=\"https:\/\/www.johndcook.com\/cumsum_asymp1.svg\" alt=\"c(n) =\u00a0t(1) +\u00a0t(2) +\u00a0t(3) + \\cdots +\u00a0t(n)\" width=\"320\" height=\"18\" \/><\/p>\n<p>The sequence\u00a0<em>c<\/em>(<em>n<\/em>) is also the number of constraints on an <em>n<\/em>-step Runge-Kutta method; that&#8217;s how I became interested in it.<\/p>\n<p>Now the\u00a0<em>t<\/em>(<em>n<\/em>) sequence has been cataloged as OEIS <a href=\"https:\/\/oeis.org\/A000081\">A000081<\/a> and OEIS gives the asymptotic estimate of\u00a0<em>t<\/em>(<em>n<\/em>) for large\u00a0<em>n<\/em> as<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" style=\"background-color: white;\" src=\"https:\/\/www.johndcook.com\/cumsum_asymp2.svg\" alt=\"t(n) \\sim C \\frac{a^n}{n^{3\/2}}\" width=\"105\" height=\"42\" \/><\/p>\n<p>where <em>C<\/em>\u00a0= 0.4399\u2026 and \u03b1 = 2.9557\u2026.<\/p>\n<p>The cumulative sum of\u00a0<em>t<\/em>(<em>n<\/em>), what I&#8217;ve called\u00a0<em>c<\/em>(<em>n<\/em>), is also cataloged in OEIS, sequence number <a href=\"https:\/\/oeis.org\/A087803\">A087803<\/a>. However, OEIS does not give an asymptotic estimate for this sequence. I&#8217;ll give one here.<\/p>\n<p>(Update: After looking closer at the page for A087803 I see that there is an asymptotic formula, the same one derived here.)<\/p>\n<p>The basis for my derivation is to assume the cumulative sum of the asymptotic estimates gives an asymptotic estimate of the cumulative sum. This is justified by the fact that the sequence is increasing rapidly and only the last few terms contribute much relatively to the sum.<\/p>\n<p>The technique illustrated here would be applicable to the cumulative sum of other series whose asymptotic form is known.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" style=\"background-color: white;\" src=\"https:\/\/www.johndcook.com\/cumsum_asymp.svg\" alt=\"\\begin{align*} c(n) &amp;= \\sum_{n=1}^N t(n) \\\\ &amp;\\sim \\sum_{n=1}^N C \\frac{a^n}{n^{3\/2}}\\\\ &amp;= C \\frac{a^N}{N^{3\/2}} \\sum_{k=0}^{N-1} a^{-k}\\left(1 - \\frac{k}{N} \\right)^{-3\/2} \\\\ &amp;\\sim C \\frac{a^N}{N^{3\/2}} \\sum_{k=0}^\\infty a^{-k} \\\\ &amp;= C \\frac{a^N}{N^{3\/2}} \\frac{a}{a-1} \\\\ &amp;= C \\frac{a^{N+1}}{(a-1)N^{3\/2}} \\end{align*} \" width=\"280\" height=\"371\" \/><\/p>\n<p>Here&#8217;s code to visualize the rate of convergence.<\/p>\n<pre>import numpy as np\r\nimport matplotlib.pyplot as plt\r\n\r\n# from https:\/\/oeis.org\/A000081\/b000081.txt\r\nA000081 = [\r\n    0,\r\n    1,\r\n    1,\r\n    2,\r\n    4,\r\n    ...\r\n    51384328351659326880337136395054298255277970,\r\n]  \r\nA087803 = np.cumsum(A000081)\r\n\r\ndef approx(n):\r\n    C = 0.43992401257102530\r\n    a = 2.95576528565199497\r\n    return C*a**(n+1)*n**(-3\/2)\/(a - 1)\r\n\r\nn = np.arange(len(A087803))\r\nratio = A087803\/approx(n)\r\n\r\nplt.plot(n[1:], ratio[1:])\r\nplt.plot(n, 0*n + 1, '--')\r\nplt.xlabel(\"$n$\")\r\nplt.ylabel(\"exact\/approx\")\r\nplt.show()\r\n<\/pre>\n<p>Here&#8217;s the plot:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium\" src=\"https:\/\/www.johndcook.com\/cumsum_asymp_plot.png\" width=\"640\" height=\"480\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this post I mentioned two series which I denoted\u00a0t(n) and\u00a0c(n). The former is the number of unlabeled rooted trees with\u00a0n nodes. The latter is the cumulative sum of the former, i.e. The sequence\u00a0c(n) is also the number of constraints on an n-step Runge-Kutta method; that&#8217;s how I became interested in it. Now the\u00a0t(n) sequence [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[9],"tags":[],"class_list":["post-247518","post","type-post","status-publish","format-standard","hentry","category-math"],"acf":[],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"Asymptotic formula for the cumulative sum of a series whose asymptotic form is known. Applied to rooted trees and Runge-Kutta constraints.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"John\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.johndcook.com\/blog\/2026\/08\/02\/estimating-a-cumulative-sum\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"John D. Cook | Applied Mathematics Consulting\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Estimating a cumulative sum\" \/>\n\t\t<meta property=\"og:description\" content=\"Asymptotic formula for the cumulative sum of a series whose asymptotic form is known. Applied to rooted trees and Runge-Kutta constraints.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.johndcook.com\/blog\/2026\/08\/02\/estimating-a-cumulative-sum\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2026-08-02T17:57:31+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2026-08-03T00:20:01+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Estimating a cumulative sum\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Asymptotic formula for the cumulative sum of a series whose asymptotic form is known. Applied to rooted trees and Runge-Kutta constraints.\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Estimating a cumulative sum","description":"Asymptotic formula for the cumulative sum of a series whose asymptotic form is known. Applied to rooted trees and Runge-Kutta constraints.","canonical_url":"https:\/\/www.johndcook.com\/blog\/2026\/08\/02\/estimating-a-cumulative-sum\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"John D. Cook | Applied Mathematics Consulting","og:type":"article","og:title":"Estimating a cumulative sum","og:description":"Asymptotic formula for the cumulative sum of a series whose asymptotic form is known. Applied to rooted trees and Runge-Kutta constraints.","og:url":"https:\/\/www.johndcook.com\/blog\/2026\/08\/02\/estimating-a-cumulative-sum\/","article:published_time":"2026-08-02T17:57:31+00:00","article:modified_time":"2026-08-03T00:20:01+00:00","twitter:card":"summary","twitter:title":"Estimating a cumulative sum","twitter:description":"Asymptotic formula for the cumulative sum of a series whose asymptotic form is known. Applied to rooted trees and Runge-Kutta constraints.","twitter:image":"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png"},"aioseo_meta_data":{"post_id":"247518","title":null,"description":"Asymptotic formula for the cumulative sum of a series whose asymptotic form is known. Applied to rooted trees and Runge-Kutta constraints.","keywords":null,"keyphrases":{"focus":[],"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"created":"2026-08-02 13:16:46","updated":"2026-08-04 10:52:23","ai":{"faqs":[],"keyPoints":[],"schemas":[],"titles":[],"descriptions":[],"socialPosts":{"email":{"subject":"","preview":"","content":""},"linkedin":[],"twitter":[],"facebook":[],"instagram":[]}},"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.johndcook.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.johndcook.com\/blog\/category\/math\/\" title=\"Math\">Math<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tEstimating a cumulative sum\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.johndcook.com\/blog"},{"label":"Math","link":"https:\/\/www.johndcook.com\/blog\/category\/math\/"},{"label":"Estimating a cumulative sum","link":"https:\/\/www.johndcook.com\/blog\/2026\/08\/02\/estimating-a-cumulative-sum\/"}],"_links":{"self":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247518","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/comments?post=247518"}],"version-history":[{"count":6,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247518\/revisions"}],"predecessor-version":[{"id":247527,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247518\/revisions\/247527"}],"wp:attachment":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/media?parent=247518"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/categories?post=247518"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/tags?post=247518"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":247512,"date":"2026-08-01T15:18:41","date_gmt":"2026-08-01T20:18:41","guid":{"rendered":"https:\/\/www.johndcook.com\/blog\/?p=247512"},"modified":"2026-08-01T16:13:18","modified_gmt":"2026-08-01T21:13:18","slug":"why-polynomial-coefficients","status":"publish","type":"post","link":"https:\/\/www.johndcook.com\/blog\/2026\/08\/01\/why-polynomial-coefficients\/","title":{"rendered":"Why polynomial coefficients?"},"content":{"rendered":"<p>Second order linear differential equations with polynomial coefficients form their own area of study. This seems like a narrow class of equations, but it&#8217;s very important in applications.<\/p>\n<p>This class of equations seems like a mathematically natural topic, but why is it so important in applications? I did a PhD in differential equations without ever learning why. The theory of second order linear equations with polynomial coefficients is too complicated for undergraduate courses [0] and too well-established for graduate courses [1]. <\/p>\n<p>The explanation that I was missing can be found in the first chapter of [2]. The PDEs that are common in physics are separable in various coordinate systems, meaning that in these coordinate systems the PDEs reduce to ODEs. These ODEs either have polynomial coefficients, or there is a change of variables which makes the ODEs have polynomial coefficients.<\/p>\n<p>See this <a href=\"https:\/\/www.johndcook.com\/separable_helmholtz.pdf\">writeup<\/a> that looks at the Helmholtz and Laplace equations in 11 coordinate systems.<\/p>\n<p>[0] You may see the simplest parts of the theory in a section on solving ODEs with power series. But textbooks don&#8217;t go very far for good reasons.<\/p>\n<p>[1] Unfortunately, a lot of really useful topics are left out of the graduate curriculum because they&#8217;re too well understood to provide thesis topics. Or the problems that are still open have been open for so long that they&#8217;re likely too hard to be cracked by a graduate student.<\/p>\n<p>[2] Gerhard Kristensson. Second Order Differential Equations: Special Functions and their Classification. Springer, 2010.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Second order linear differential equations with polynomial coefficients form their own area of study. This seems like a narrow class of equations, but it&#8217;s very important in applications. This class of equations seems like a mathematically natural topic, but why is it so important in applications? I did a PhD in differential equations without ever [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[9],"tags":[47,170],"class_list":["post-247512","post","type-post","status-publish","format-standard","hentry","category-math","tag-differential-equations","tag-science"],"acf":[],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"Why is one special area of differential equations -- linear second order equations with polynomial coefficients -- so mature and important in applications?\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"John\"\/>\n\t<meta name=\"keywords\" content=\"differential equations,science\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.johndcook.com\/blog\/2026\/08\/01\/why-polynomial-coefficients\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"John D. Cook | Applied Mathematics Consulting\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Why polynomial coefficients?\" \/>\n\t\t<meta property=\"og:description\" content=\"Why is one special area of differential equations -- linear second order equations with polynomial coefficients -- so mature and important in applications?\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.johndcook.com\/blog\/2026\/08\/01\/why-polynomial-coefficients\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2026-08-01T20:18:41+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2026-08-01T21:13:18+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Why polynomial coefficients?\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Why is one special area of differential equations -- linear second order equations with polynomial coefficients -- so mature and important in applications?\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Why polynomial coefficients?","description":"Why is one special area of differential equations -- linear second order equations with polynomial coefficients -- so mature and important in applications?","canonical_url":"https:\/\/www.johndcook.com\/blog\/2026\/08\/01\/why-polynomial-coefficients\/","robots":"max-image-preview:large","keywords":"differential equations,science","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"John D. Cook | Applied Mathematics Consulting","og:type":"article","og:title":"Why polynomial coefficients?","og:description":"Why is one special area of differential equations -- linear second order equations with polynomial coefficients -- so mature and important in applications?","og:url":"https:\/\/www.johndcook.com\/blog\/2026\/08\/01\/why-polynomial-coefficients\/","article:published_time":"2026-08-01T20:18:41+00:00","article:modified_time":"2026-08-01T21:13:18+00:00","twitter:card":"summary","twitter:title":"Why polynomial coefficients?","twitter:description":"Why is one special area of differential equations -- linear second order equations with polynomial coefficients -- so mature and important in applications?","twitter:image":"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png"},"aioseo_meta_data":{"post_id":"247512","title":null,"description":"Why is one special area of differential equations -- linear second order equations with polynomial coefficients -- so mature and important in applications?","keywords":null,"keyphrases":{"focus":[],"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"created":"2026-08-01 18:36:06","updated":"2026-08-04 10:52:24","ai":{"faqs":[],"keyPoints":[],"schemas":[],"titles":[],"descriptions":[],"socialPosts":{"email":{"subject":"","preview":"","content":""},"linkedin":[],"twitter":[],"facebook":[],"instagram":[]}},"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.johndcook.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.johndcook.com\/blog\/category\/math\/\" title=\"Math\">Math<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tWhy polynomial coefficients?\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.johndcook.com\/blog"},{"label":"Math","link":"https:\/\/www.johndcook.com\/blog\/category\/math\/"},{"label":"Why polynomial coefficients?","link":"https:\/\/www.johndcook.com\/blog\/2026\/08\/01\/why-polynomial-coefficients\/"}],"_links":{"self":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247512","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/comments?post=247512"}],"version-history":[{"count":4,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247512\/revisions"}],"predecessor-version":[{"id":247516,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247512\/revisions\/247516"}],"wp:attachment":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/media?parent=247512"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/categories?post=247512"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/tags?post=247512"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":247502,"date":"2026-08-01T11:15:53","date_gmt":"2026-08-01T16:15:53","guid":{"rendered":"https:\/\/www.johndcook.com\/blog\/?p=247502"},"modified":"2026-08-02T19:19:33","modified_gmt":"2026-08-03T00:19:33","slug":"counting-rooted-trees","status":"publish","type":"post","link":"https:\/\/www.johndcook.com\/blog\/2026\/08\/01\/counting-rooted-trees\/","title":{"rendered":"Counting rooted trees"},"content":{"rendered":"<p>Combinatorial problems can be interesting for their own sake, but they are more interesting when there is a connection to a problem outside combinatorics, and the more unexpected the connection the better.<\/p>\n<p>Counting the number of unlabeled rooted trees [1] with <em>n<\/em> nodes is a pure mathematics problem. Designing numerical methods for solving differential equations is an applied mathematics problem. And yet the two are closely linked.<\/p>\n<p>Let <em>t<\/em>(<em>n<\/em>) be the number of distinct unlabeled rooted trees with <em>n<\/em> nodes. The diagram below shows that the first few terms of this sequence are 1, 1, 2, and 4.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium\" style=\"background-color: white;\" src=\"https:\/\/www.johndcook.com\/rooted_trees_order_1_to_4.svg\" width=\"680\" height=\"600\" \/><\/p>\n<p>In an <a href=\"https:\/\/www.johndcook.com\/blog\/2026\/07\/31\/runge-kutta-design\/\">earlier post<\/a> I showed that designing a 4-stage explicit Runge-Kutta method required solving a system of 8 equations in 10 unknowns, leaving two degrees of freedom in the solutions.<\/p>\n<p>The number of constraints <em>c<\/em>(<em>s<\/em>) needed to design an <em>s<\/em>-stage explicit RK method is equal to the number of rooted trees with up to <em>s<\/em> nodes:<\/p>\n<p style=\"padding-left: 40px;\"><em>c<\/em>(<em>s<\/em>) = <em>t<\/em>(1) + <em>t<\/em>(2) + <em>t<\/em>(3) + \u2026 + <em>t<\/em>(<em>s<\/em>)<\/p>\n<p>This is because there is a one-to-one correspondence between constraints on the <em>n<\/em>th derivative of an RK formula and rooted trees, and an\u00a0<em>s<\/em> stage method has to satisfy the constraints of all stages up to\u00a0<em>s<\/em>. In the example of the 4th order RK method, we have<\/p>\n<p style=\"padding-left: 40px;\"><em>c<\/em>(4) =\u00a0<em>t<\/em>(1) +\u00a0<em>t<\/em>(2)\u00a0 +\u00a0<em>t<\/em>(3) +\u00a0<em>t<\/em>(4) = 1 + 1 + 2 + 4 = 8.<\/p>\n<p>The first few values [2] of <em>t<\/em>(<em>n<\/em>) are<\/p>\n<p style=\"padding-left: 40px;\">1, 1, 2, 4, 9, 20, 48, 115, 286, 719, 1842, 4766, 12486, 32973, \u2026<\/p>\n<p>and so you can see that\u00a0<em>t<\/em>(<em>n<\/em>) grows quickly. In fact, it grows exponentially [3].<\/p>\n<p>However, the number of parameters in an\u00a0<em>s<\/em> stage RK method is\u00a0<em>s<\/em>(<em>s<\/em> + 1)\/2. The number of equations grows exponentially and the number of variables grows only quadratically, so at some point you have more equations than variables. That&#8217;s already the case for <em>s<\/em> = 5 because you have 17 constraints on 15 variables.\u00a0The system has a solution because symmetry considerations render some of the equations redundant.<\/p>\n<p>A 10th order RK method requires 17 stages. (See the <a href=\"https:\/\/www.johndcook.com\/blog\/2026\/08\/01\/butcher-barrier\/\">previous post<\/a> for why the number of stages exceeds the order when the order is greater than 4.) Designing such a method would require solving over a million equations in 153 variables, and yet it can be done. [4]<\/p>\n<h2>Related posts<\/h2>\n<ul>\n<li class=\"link\"><a href=\"https:\/\/www.johndcook.com\/blog\/2026\/07\/31\/runge-kutta-design\/\">Solving the RK4 equations<\/a><\/li>\n<li class=\"link\"><a href=\"https:\/\/www.johndcook.com\/blog\/2026\/07\/27\/counting-permutations-with-roots\/\">Counting permutations with roots<\/a><\/li>\n<li class=\"link\"><a href=\"https:\/\/www.johndcook.com\/blog\/2026\/06\/30\/dna-sequence-alignment-and-kings\/\">DNA alignment and Kings<\/a><\/li>\n<\/ul>\n<p>[1] This is a slightly contradictory term. Unlabeled means the we don&#8217;t distinguish the nodes. But we do distinguish one node, namely the root.<\/p>\n<p>[2] See OEIS <a href=\"https:\/\/oeis.org\/A000081\">A000081<\/a>.<\/p>\n<p>[2] Richard Otter proved in 1948 that the number of unlabeled rooted trees with\u00a0<em>n<\/em> nodes is asymptotically <em>C<\/em> \u03b1<sup><em>n<\/em><\/sup> \/ <em>n<\/em><sup>\u22123\/2<\/sup> where\u00a0<em>C<\/em> = 0.4399\u2026 and \u03b1 = 2.9557\u2026. The cumulative sum is at least this large since Otter&#8217;s estimate gives the size of the last term in the sum.<\/p>\n<p>[3] E. Hairer. A Runge-Kutta Method of Order 10. J. Inst. Maths Applics (1978) 21, 47-59<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Combinatorial problems can be interesting for their own sake, but they are more interesting when there is a connection to a problem outside combinatorics, and the more unexpected the connection the better. Counting the number of unlabeled rooted trees [1] with n nodes is a pure mathematics problem. Designing numerical methods for solving differential equations [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[9],"tags":[197,47],"class_list":["post-247502","post","type-post","status-publish","format-standard","hentry","category-math","tag-combinatorics","tag-differential-equations"],"acf":[],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"The pure math problem of counting rooted trees is closely connected with the applied math problem of designing differential equation solvers.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"John\"\/>\n\t<meta name=\"keywords\" content=\"combinatorics,differential equations\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.johndcook.com\/blog\/2026\/08\/01\/counting-rooted-trees\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"John D. Cook | Applied Mathematics Consulting\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Counting rooted trees\" \/>\n\t\t<meta property=\"og:description\" content=\"The pure math problem of counting rooted trees is closely connected with the applied math problem of designing differential equation solvers.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.johndcook.com\/blog\/2026\/08\/01\/counting-rooted-trees\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2026-08-01T16:15:53+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2026-08-03T00:19:33+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Counting rooted trees\" \/>\n\t\t<meta name=\"twitter:description\" content=\"The pure math problem of counting rooted trees is closely connected with the applied math problem of designing differential equation solvers.\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Counting rooted trees","description":"The pure math problem of counting rooted trees is closely connected with the applied math problem of designing differential equation solvers.","canonical_url":"https:\/\/www.johndcook.com\/blog\/2026\/08\/01\/counting-rooted-trees\/","robots":"max-image-preview:large","keywords":"combinatorics,differential equations","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"John D. Cook | Applied Mathematics Consulting","og:type":"article","og:title":"Counting rooted trees","og:description":"The pure math problem of counting rooted trees is closely connected with the applied math problem of designing differential equation solvers.","og:url":"https:\/\/www.johndcook.com\/blog\/2026\/08\/01\/counting-rooted-trees\/","article:published_time":"2026-08-01T16:15:53+00:00","article:modified_time":"2026-08-03T00:19:33+00:00","twitter:card":"summary","twitter:title":"Counting rooted trees","twitter:description":"The pure math problem of counting rooted trees is closely connected with the applied math problem of designing differential equation solvers.","twitter:image":"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png"},"aioseo_meta_data":{"post_id":"247502","title":null,"description":"The pure math problem of counting rooted trees is closely connected with the applied math problem of designing differential equation solvers.","keywords":null,"keyphrases":{"focus":[],"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"created":"2026-08-01 14:08:24","updated":"2026-08-04 10:52:24","ai":{"faqs":[],"keyPoints":[],"schemas":[],"titles":[],"descriptions":[],"socialPosts":{"email":{"subject":"","preview":"","content":""},"linkedin":[],"twitter":[],"facebook":[],"instagram":[]}},"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.johndcook.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.johndcook.com\/blog\/category\/math\/\" title=\"Math\">Math<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tCounting rooted trees\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.johndcook.com\/blog"},{"label":"Math","link":"https:\/\/www.johndcook.com\/blog\/category\/math\/"},{"label":"Counting rooted trees","link":"https:\/\/www.johndcook.com\/blog\/2026\/08\/01\/counting-rooted-trees\/"}],"_links":{"self":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247502","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/comments?post=247502"}],"version-history":[{"count":9,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247502\/revisions"}],"predecessor-version":[{"id":247526,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247502\/revisions\/247526"}],"wp:attachment":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/media?parent=247502"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/categories?post=247502"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/tags?post=247502"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":247499,"date":"2026-08-01T10:58:15","date_gmt":"2026-08-01T15:58:15","guid":{"rendered":"https:\/\/www.johndcook.com\/blog\/?p=247499"},"modified":"2026-08-01T10:58:15","modified_gmt":"2026-08-01T15:58:15","slug":"butcher-barrier","status":"publish","type":"post","link":"https:\/\/www.johndcook.com\/blog\/2026\/08\/01\/butcher-barrier\/","title":{"rendered":"Runge-Kutta order versus stages"},"content":{"rendered":"<p>The textbook version of the Runge-Kutta method for solving differential equations has 4 stages and has 4th order error. For lower order versions of RK the number of stages <em>s<\/em> also matches the order of the error <em>p<\/em>. But in order to achieve error on the order of\u00a0<em>p<\/em> \u2265 5, you need more than <em>p<\/em> stages. This is known as the Butcher barrier.<\/p>\n<p>Before going any further, let&#8217;s back up and say what we mean by stages and by order.<\/p>\n<h2>Stages<\/h2>\n<p>The number of stages in an RK method to solve the equation<\/p>\n<p><img decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/www.johndcook.com\/first_order_ode.svg\" alt=\"y' = f(t, y)\" width=\"82\" \/><\/p>\n<p>is the number of evaluations of the function\u00a0<em>f<\/em> on the right-hand side. For example, the textbook RK4 method estimates the solution at each step by<\/p>\n<p><img decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/www.johndcook.com\/rk4.svg\" alt=\"y_{n+1} = y_n + \\frac{h}{6}\\left( k_{n1} + 2k_{n2} + 2k_{n3} + k_{n4}\\right)\" width=\"305\" \/><\/p>\n<p>where<\/p>\n<p><img decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/www.johndcook.com\/rk4k.svg\" alt=\"k_{n1} &amp;=&amp; f(t_n, y_n) \\\\ k_{n2} &amp;=&amp; f(t_n + 0.5h, y_n + 0.5hk_{n1}) \\\\ k_{n3} &amp;=&amp; f(t_n + 0.5h, y_n + 0.5hk_{n2}) \\\\ k_{n4} &amp;=&amp; f(t_n + h, y_n + hk_{n3}) \\\\\" width=\"280\" \/><\/p>\n<p>which requires four stages, i.e. four evaluations of\u00a0<em>f<\/em>.<\/p>\n<h2>Order<\/h2>\n<p>A differential equation solver is said to have order <em>p<\/em> if the local error, the error after one step of size <em>h<\/em>, is <em>O<\/em>(<em>h<\/em><sup><em>p<\/em> + 1<\/sup>). Then after solving an ODE over a period of time <em>T<\/em> with <em>N<\/em> = <em>T<\/em>\/<em>h<\/em> steps, the global error is <em>O<\/em>(<em>h<\/em><sup><em>p<\/em><\/sup>). So, for example, if <em>p<\/em> = 4, you would expect that cutting your step size <em>h<\/em> in half would cut your error at <em>T<\/em> by a factor of 16.<\/p>\n<h2>More stages than the order<\/h2>\n<p>John C. Butcher proved that an explicit RK method of order <em>p<\/em> requires\u00a0<em>s<\/em> stages where\u00a0<em>s<\/em> &gt;\u00a0<em>p<\/em> if\u00a0<em>p<\/em> &gt; 4.<\/p>\n<p>An important example is the Dormand-Prince method. It is a version of RK that has order 5 and 7 stages. The clever thing about this method is that you can make a 4th order solver out of a subset of its function evaluations.<\/p>\n<p>That means that after you&#8217;ve evaluated one step of the 5th order method, you can also evaluate a 4th order method essentially for free. And by comparing them, you can get a sense of the error. If the solutions given by the two methods are substantially different, you have probably taken too big a step and need to back up. If the two solutions essentially agree, you&#8217;re probably good to take the next step.<\/p>\n<p>For an explict RK method to have order 5, 6, or 7 you need at least 6, 7, or 9 stages respectively.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The textbook version of the Runge-Kutta method for solving differential equations has 4 stages and has 4th order error. For lower order versions of RK the number of stages s also matches the order of the error p. But in order to achieve error on the order of\u00a0p \u2265 5, you need more than p [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[9],"tags":[47],"class_list":["post-247499","post","type-post","status-publish","format-standard","hentry","category-math","tag-differential-equations"],"acf":[],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"A Runge-Kutta method of order n has n stages only for n = 1, 2, 3, and 4. After that, the number of stages must exceed the order.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"John\"\/>\n\t<meta name=\"keywords\" content=\"differential equations\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.johndcook.com\/blog\/2026\/08\/01\/butcher-barrier\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"John D. Cook | Applied Mathematics Consulting\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Runge-Kutta: over versus stages | Butcher barrier\" \/>\n\t\t<meta property=\"og:description\" content=\"A Runge-Kutta method of order n has n stages only for n = 1, 2, 3, and 4. After that, the number of stages must exceed the order.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.johndcook.com\/blog\/2026\/08\/01\/butcher-barrier\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2026-08-01T15:58:15+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2026-08-01T15:58:15+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Runge-Kutta: over versus stages | Butcher barrier\" \/>\n\t\t<meta name=\"twitter:description\" content=\"A Runge-Kutta method of order n has n stages only for n = 1, 2, 3, and 4. After that, the number of stages must exceed the order.\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Runge-Kutta: over versus stages | Butcher barrier","description":"A Runge-Kutta method of order n has n stages only for n = 1, 2, 3, and 4. After that, the number of stages must exceed the order.","canonical_url":"https:\/\/www.johndcook.com\/blog\/2026\/08\/01\/butcher-barrier\/","robots":"max-image-preview:large","keywords":"differential equations","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"John D. Cook | Applied Mathematics Consulting","og:type":"article","og:title":"Runge-Kutta: over versus stages | Butcher barrier","og:description":"A Runge-Kutta method of order n has n stages only for n = 1, 2, 3, and 4. After that, the number of stages must exceed the order.","og:url":"https:\/\/www.johndcook.com\/blog\/2026\/08\/01\/butcher-barrier\/","article:published_time":"2026-08-01T15:58:15+00:00","article:modified_time":"2026-08-01T15:58:15+00:00","twitter:card":"summary","twitter:title":"Runge-Kutta: over versus stages | Butcher barrier","twitter:description":"A Runge-Kutta method of order n has n stages only for n = 1, 2, 3, and 4. After that, the number of stages must exceed the order.","twitter:image":"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png"},"aioseo_meta_data":{"post_id":"247499","title":"Runge-Kutta: over versus stages | Butcher barrier","description":"A Runge-Kutta method of order n has n stages only for n = 1, 2, 3, and 4. After that, the number of stages must exceed the order.","keywords":null,"keyphrases":{"focus":[],"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"created":"2026-08-01 11:53:29","updated":"2026-08-04 10:52:24","ai":{"faqs":[],"keyPoints":[],"schemas":[],"titles":[],"descriptions":[],"socialPosts":{"email":{"subject":"","preview":"","content":""},"linkedin":[],"twitter":[],"facebook":[],"instagram":[]}},"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.johndcook.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.johndcook.com\/blog\/category\/math\/\" title=\"Math\">Math<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tRunge-Kutta order versus stages\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.johndcook.com\/blog"},{"label":"Math","link":"https:\/\/www.johndcook.com\/blog\/category\/math\/"},{"label":"Runge-Kutta order versus stages","link":"https:\/\/www.johndcook.com\/blog\/2026\/08\/01\/butcher-barrier\/"}],"_links":{"self":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247499","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/comments?post=247499"}],"version-history":[{"count":3,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247499\/revisions"}],"predecessor-version":[{"id":247506,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247499\/revisions\/247506"}],"wp:attachment":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/media?parent=247499"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/categories?post=247499"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/tags?post=247499"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":247492,"date":"2026-07-31T13:59:02","date_gmt":"2026-07-31T18:59:02","guid":{"rendered":"https:\/\/www.johndcook.com\/blog\/?p=247492"},"modified":"2026-08-01T20:51:08","modified_gmt":"2026-08-02T01:51:08","slug":"runge-kutta-design","status":"publish","type":"post","link":"https:\/\/www.johndcook.com\/blog\/2026\/07\/31\/runge-kutta-design\/","title":{"rendered":"Solving the RK4 design equations"},"content":{"rendered":"<p>I was digging into the Runge-Kutta method for solving differential equations and a line from [1] piqued my curiosity.<\/p>\n<p style=\"padding-left: 40px;\">These calculations, which are not reproduced in Kutta&#8217;s paper (they are however in Huen (1900)), are very tedious.<\/p>\n<p>The calculations are a set of eight constraints that the parameters of a fourth-order Runge-Kutta method must satisfy. I wondered how well Mathematica might have done at assisting Mr. Huen in his &#8220;very tedious&#8221; calculations if it had been available in 1900.<\/p>\n<p>I go into Runge-Kutta methods in <a href=\"https:\/\/www.johndcook.com\/blog\/2020\/02\/13\/runge-kutta-methods\/\">this post<\/a>. Here I&#8217;d like to concentrate on a step in the design of the methods, namely solving the set of equations alluded in the quote above.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" style=\"background-color: white;\" src=\"https:\/\/www.johndcook.com\/RK4.svg\" alt=\"\\begin{align*} b_1 + b_2 + b_3 + b_4 &amp;= 1 \\\\ b_2 c_2 + b_3 c_3 + b_4 c_4 &amp;= \\frac{1}{2} \\\\ b_2 c_2^2 + b_3 c_3^2 + b_4 c_4^2 &amp;= \\frac{1}{3} \\\\ b_3 a_{32} c_2 + b_4(a_{42} c_2 + a_{43} c_3) &amp;= \\frac{1}{6} \\\\ b_2 c_2^3 + b_3 c_3^3 + b_4 c_4^3 &amp;= \\frac{1}{4} \\\\ b_3 c_3 a_{32} c_2 + b_4 c_4(a_{42} c_2 + a_{43} c_3) &amp;= \\frac{1}{8} \\\\ b_3 a_{32} c_2^2 + b_4(a_{42} c_2^2 + a_{43} c_3^2) &amp;= \\frac{1}{12} \\\\ b_4 a_{43} a_{32} c_2 &amp;= \\frac{1}{24} \\end{align*} \" width=\"297\" height=\"353\" \/><\/p>\n<p>The first thing to note is that there are 10 variables and only 8 equations, and so the solution is not fully determined. What we think of as\u00a0<em>the<\/em> fourth order Runge-Kutta method is in fact\u00a0<em>a<\/em> fourth order Runge-Kutta method.<\/p>\n<p>One could argue that we should have <em>b<\/em><sub>2<\/sub> = <em>b<\/em><sub>3<\/sub> and <em>c<\/em><sub>2<\/sub> = <em>c<\/em><sub>3<\/sub>. With these additional equations, the system of equations has a unique solution, and Mathematic finds it easily.<\/p>\n<pre>eqs = {\r\n    b1 + b2 + b3 + b4 == 1,\r\n    b2*c2 + b3*c3 + b4*c4 == 1\/2,\r\n    b2*c2^2 + b3*c3^2 + b4*c4^2 == 1\/3,\r\n    b3*a32*c2 + b4*(a42*c2 + a43*c3) == 1\/6,\r\n    b2*c2^3 + b3*c3^3 + b4*c4^3 == 1\/4,\r\n    b3*c3*a32*c2 + b4*c4*(a42*c2 + a43*c3) == 1\/8,\r\n    b3*a32*c2^2 + b4*(a42*c2^2 + a43*c3^2) == 1\/12,\r\n    b4*a43*a32*c2 == 1\/24,\r\n    b2 == b3,\r\n    c2 == c3\r\n};\r\n\r\nvars = {b1, b2, b3, b4, c2, c3, c4, a32, a42, a43};\r\n\r\nsolution = Solve[eqs, vars]\r\n<\/pre>\n<p>This returns the parameters used for the version of Runge-Kutta presented in every textbook.<\/p>\n<p>If you keep the requirement <em>b<\/em><sub>2<\/sub> = <em>b<\/em><sub>3<\/sub> but substitute the requirement 2<em>c<\/em><sub>2<\/sub> = <em>c<\/em><sub>3<\/sub> for <em>c<\/em>&#8216;s Mathematica will return the coefficients for the so-called Runge-Kutta 3\/8 rule. This method has some slight advantages by some criteria.<\/p>\n<p>In 1951 Gill [2] discovered a fourth order Runge-Kutta rule optimized for running in extremely constrained computer hardware. It&#8217;s a strange method, with irrational parameters, but one that was a very clever response to the limitations of its time.<\/p>\n<p><strong>Update<\/strong>: See <a href=\"https:\/\/www.johndcook.com\/blog\/2026\/08\/01\/counting-rooted-trees\/\">this post<\/a> for a discussion of the parameters and constriants for higher-ordered RK methods.<\/p>\n<h2>Related posts<\/h2>\n<ul>\n<li class=\"link\"><a href=\"https:\/\/www.johndcook.com\/blog\/2020\/02\/19\/dormand-prince\/\">Dormand and Prince<\/a><\/li>\n<li class=\"link\"><a href=\"https:\/\/www.johndcook.com\/blog\/2016\/06\/02\/ode-solver-as-a-functional-fold\/\">RK4 as a fold<\/a><\/li>\n<li class=\"link\"><a href=\"https:\/\/www.johndcook.com\/blog\/2020\/02\/02\/stiff-differential-equations\/\">Stiff differential equations<\/a><\/li>\n<\/ul>\n<p>[1] Hairer, N\u00f8rsett, and Wanner. Solving Ordinary Differential Equations I: Nonstiff Problems. Springer-Verlag 1987.<\/p>\n<p>[2] A. Gill. A process for the step-by-step integration of differential equations in an automatic digital computing machine. Proc. Cambridge Philos. Soc., vol 27, pp 95\u2013108.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was digging into the Runge-Kutta method for solving differential equations and a line from [1] piqued my curiosity. These calculations, which are not reproduced in Kutta&#8217;s paper (they are however in Huen (1900)), are very tedious. The calculations are a set of eight constraints that the parameters of a fourth-order Runge-Kutta method must satisfy. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[9],"tags":[47,87],"class_list":["post-247492","post","type-post","status-publish","format-standard","hentry","category-math","tag-differential-equations","tag-mathematica"],"acf":[],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"The constraints on Runge-Kutta method parameters are complicated. How well could Mathematica do at solving them?\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"John\"\/>\n\t<meta name=\"keywords\" content=\"differential equations,mathematica\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.johndcook.com\/blog\/2026\/07\/31\/runge-kutta-design\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"John D. Cook | Applied Mathematics Consulting\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Solving the fourth order Runge-Kutta design equations\" \/>\n\t\t<meta property=\"og:description\" content=\"The constraints on Runge-Kutta method parameters are complicated. How well could Mathematica do at solving them?\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.johndcook.com\/blog\/2026\/07\/31\/runge-kutta-design\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2026-07-31T18:59:02+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2026-08-02T01:51:08+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Solving the fourth order Runge-Kutta design equations\" \/>\n\t\t<meta name=\"twitter:description\" content=\"The constraints on Runge-Kutta method parameters are complicated. How well could Mathematica do at solving them?\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Solving the fourth order Runge-Kutta design equations","description":"The constraints on Runge-Kutta method parameters are complicated. How well could Mathematica do at solving them?","canonical_url":"https:\/\/www.johndcook.com\/blog\/2026\/07\/31\/runge-kutta-design\/","robots":"max-image-preview:large","keywords":"differential equations,mathematica","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"John D. Cook | Applied Mathematics Consulting","og:type":"article","og:title":"Solving the fourth order Runge-Kutta design equations","og:description":"The constraints on Runge-Kutta method parameters are complicated. How well could Mathematica do at solving them?","og:url":"https:\/\/www.johndcook.com\/blog\/2026\/07\/31\/runge-kutta-design\/","article:published_time":"2026-07-31T18:59:02+00:00","article:modified_time":"2026-08-02T01:51:08+00:00","twitter:card":"summary","twitter:title":"Solving the fourth order Runge-Kutta design equations","twitter:description":"The constraints on Runge-Kutta method parameters are complicated. How well could Mathematica do at solving them?","twitter:image":"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png"},"aioseo_meta_data":{"post_id":"247492","title":"Solving the fourth order Runge-Kutta design equations","description":"The constraints on Runge-Kutta method parameters are complicated. How well could Mathematica do at solving them?","keywords":null,"keyphrases":{"focus":[],"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"created":"2026-07-31 17:38:42","updated":"2026-08-04 10:52:24","ai":{"faqs":[],"keyPoints":[],"schemas":[],"titles":[],"descriptions":[],"socialPosts":{"email":{"subject":"","preview":"","content":""},"linkedin":[],"twitter":[],"facebook":[],"instagram":[]}},"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.johndcook.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.johndcook.com\/blog\/category\/math\/\" title=\"Math\">Math<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tSolving the RK4 design equations\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.johndcook.com\/blog"},{"label":"Math","link":"https:\/\/www.johndcook.com\/blog\/category\/math\/"},{"label":"Solving the RK4 design equations","link":"https:\/\/www.johndcook.com\/blog\/2026\/07\/31\/runge-kutta-design\/"}],"_links":{"self":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247492","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/comments?post=247492"}],"version-history":[{"count":5,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247492\/revisions"}],"predecessor-version":[{"id":247517,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247492\/revisions\/247517"}],"wp:attachment":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/media?parent=247492"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/categories?post=247492"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/tags?post=247492"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":247470,"date":"2026-07-28T09:11:30","date_gmt":"2026-07-28T14:11:30","guid":{"rendered":"https:\/\/www.johndcook.com\/blog\/?p=247470"},"modified":"2026-07-28T13:39:02","modified_gmt":"2026-07-28T18:39:02","slug":"inverse-factorial-improved","status":"publish","type":"post","link":"https:\/\/www.johndcook.com\/blog\/2026\/07\/28\/inverse-factorial-improved\/","title":{"rendered":"Inverse factorial improved"},"content":{"rendered":"<p><a href=\"https:\/\/www.johndcook.com\/blog\/2024\/01\/01\/inverse-factorial\/\">A couple years ago<\/a> I wrote about how to compute the inverse of factorial. I used that code in writing the previous post because the post required solving the equation<\/p>\n<p style=\"padding-left: 40px;\">\u230alog<sub>2<\/sub>(<em>n<\/em>!)\u230b \u2265 <em>b<\/em><\/p>\n<p>given <em>b<\/em>. That is, given a number of bits <em>b<\/em>, find the smallest value of <em>n<\/em>\u00a0such that <em>n<\/em>! \u2265 2<sup><em>b<\/em><\/sup>.<\/p>\n<h2>What the code got right<\/h2>\n<p>Looking back on the code in that post, there are a few changes I&#8217;d like to make. But first of all, I&#8217;d like to point out something the post does right: instead of trying to solve<\/p>\n<p style=\"padding-left: 40px;\">\u0393(<em>y<\/em>) = <em>x<\/em><\/p>\n<p>it solves<\/p>\n<p style=\"padding-left: 40px;\">log \u0393(<em>y<\/em>) = log <em>x<\/em>.<\/p>\n<p>That&#8217;s why the argument to <code>inverse_log_gamma<\/code> is <code>logarg<\/code>. That makes the code useful for values of\u00a0<em>x<\/em> that would far exceed the maximum floating point value, such as in the calculations for the previous post.<\/p>\n<h2>What I&#8217;d change<\/h2>\n<h3>Rounding<\/h3>\n<p>The function <code>inverse_factorial<\/code> from the old post solves finds the closest integer solution. It would be better for it to return the solution without rounding and then let the user round result if they want to. In my calculations in the previous post, I wanted to take the floor, not round.<\/p>\n<h3>Newton&#8217;s method<\/h3>\n<p>The code in the previous post uses the bisection method. This method is very safe, and fast enough for my purposes, but it could be made faster. Newton&#8217;s method is faster, but it can be ill-behaved if you don&#8217;t start close enough to the solution.<\/p>\n<p>It&#8217;s safe to use Newton&#8217;s method to invert log \u0393 for two reasons. First, you can get a good starting point based on Stirling&#8217;s approximation. Second, and more importantly, log \u0393 is convex. Newton&#8217;s method will converge from\u00a0<em>any<\/em> starting point when applied to a convex function. A little caution is necessary because log \u0393 is not convex everywhere, but it is convex on the positive real axis.<\/p>\n<p>Another difficulty with Newton&#8217;s method is that you need to supply the derivative of the function whose root you&#8217;re trying to find. But this isn&#8217;t an issue here because the derivative of log \u0393 is the digamma function, which is implemented in SciPy.<\/p>\n<h3>Tolerance<\/h3>\n<p>Finally, the previous code used the default tolerance for deciding when to stop refining the solution. The revised method lets the user specify tolerance. It provides a default value, but that default is visible in the function call, not hidden down in SciPy.<\/p>\n<h2>Revised code<\/h2>\n<p>Here&#8217;s the revised code.<\/p>\n<pre>from scipy.special import gammaln, digamma\r\nfrom scipy.optimize import newton\r\n\r\ndef inverse_log_gamma(logarg, tol=1e-12):\r\n    assert(logarg &gt; 0)    \r\n    x0 = logarg \/ log(logarg + 1) + 1 if logarg &gt; 1 else 2.0\r\n    def f(z): return gammaln(z) - logarg\r\n    return newton(f, x0, fprime=digamma, tol=tol)\r\n\r\ndef inverse_factorial(logarg):\r\n    g = inverse_log_gamma(logarg)\r\n    return g - 1 \r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>A couple years ago I wrote about how to compute the inverse of factorial. I used that code in writing the previous post because the post required solving the equation \u230alog2(n!)\u230b \u2265 b given b. That is, given a number of bits b, find the smallest value of n\u00a0such that n! \u2265 2b. What the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[9],"tags":[129],"class_list":["post-247470","post","type-post","status-publish","format-standard","hentry","category-math","tag-special-functions"],"acf":[],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"Improved code for solving x! = y or more generally \u0393(x) = y for x.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"John\"\/>\n\t<meta name=\"keywords\" content=\"special functions\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.johndcook.com\/blog\/2026\/07\/28\/inverse-factorial-improved\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"John D. Cook | Applied Mathematics Consulting\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Efficient code for inverting the (log) gamma function\" \/>\n\t\t<meta property=\"og:description\" content=\"Improved code for solving x! = y or more generally \u0393(x) = y for x.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.johndcook.com\/blog\/2026\/07\/28\/inverse-factorial-improved\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2026-07-28T14:11:30+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2026-07-28T18:39:02+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Efficient code for inverting the (log) gamma function\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Improved code for solving x! = y or more generally \u0393(x) = y for x.\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Efficient code for inverting the (log) gamma function","description":"Improved code for solving x! = y or more generally \u0393(x) = y for x.","canonical_url":"https:\/\/www.johndcook.com\/blog\/2026\/07\/28\/inverse-factorial-improved\/","robots":"max-image-preview:large","keywords":"special functions","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"John D. Cook | Applied Mathematics Consulting","og:type":"article","og:title":"Efficient code for inverting the (log) gamma function","og:description":"Improved code for solving x! = y or more generally \u0393(x) = y for x.","og:url":"https:\/\/www.johndcook.com\/blog\/2026\/07\/28\/inverse-factorial-improved\/","article:published_time":"2026-07-28T14:11:30+00:00","article:modified_time":"2026-07-28T18:39:02+00:00","twitter:card":"summary","twitter:title":"Efficient code for inverting the (log) gamma function","twitter:description":"Improved code for solving x! = y or more generally \u0393(x) = y for x.","twitter:image":"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png"},"aioseo_meta_data":{"post_id":"247470","title":"Efficient code for inverting the (log) gamma function","description":"Improved code for solving x! = y or more generally \u0393(x) = y for x.","keywords":null,"keyphrases":{"focus":[],"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"created":"2026-07-28 13:38:46","updated":"2026-08-04 10:52:24","ai":{"faqs":[],"keyPoints":[],"schemas":[],"titles":[],"descriptions":[],"socialPosts":{"email":{"subject":"","preview":"","content":""},"linkedin":[],"twitter":[],"facebook":[],"instagram":[]}},"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.johndcook.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.johndcook.com\/blog\/category\/math\/\" title=\"Math\">Math<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tInverse factorial improved\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.johndcook.com\/blog"},{"label":"Math","link":"https:\/\/www.johndcook.com\/blog\/category\/math\/"},{"label":"Inverse factorial improved","link":"https:\/\/www.johndcook.com\/blog\/2026\/07\/28\/inverse-factorial-improved\/"}],"_links":{"self":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247470","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/comments?post=247470"}],"version-history":[{"count":2,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247470\/revisions"}],"predecessor-version":[{"id":247476,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247470\/revisions\/247476"}],"wp:attachment":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/media?parent=247470"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/categories?post=247470"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/tags?post=247470"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":247468,"date":"2026-07-28T07:13:17","date_gmt":"2026-07-28T12:13:17","guid":{"rendered":"https:\/\/www.johndcook.com\/blog\/?p=247468"},"modified":"2026-07-28T13:11:18","modified_gmt":"2026-07-28T18:11:18","slug":"keys-and-cards","status":"publish","type":"post","link":"https:\/\/www.johndcook.com\/blog\/2026\/07\/28\/keys-and-cards\/","title":{"rendered":"Cryptographic Keys and Decks of Cards"},"content":{"rendered":"<p>The <a href=\"https:\/\/www.johndcook.com\/blog\/2026\/07\/27\/hiding-data-in-permutations\/\">previous post<\/a> looked at the idea of storing a cryptographic key in the order of a deck of cards. A deck of 52 cards can store 225 bits of data because<\/p>\n<p style=\"padding-left: 40px;\">\u230alog<sub>2<\/sub>(52!)\u230b = 225.<\/p>\n<p>Here \u230a<em>x<\/em>\u230b is\u00a0<em>x<\/em> rounded down to the nearest integer.<\/p>\n<p>If we want to store bigger keys, we&#8217;re going to need a bigger deck of cards.<\/p>\n<h2>Bitcoin<\/h2>\n<p>A Bitcoin key has 256 bits, which would require a deck of 58 cards. There is a card game called Zwicker that uses a deck of 58 cards, the usual 52 cards plus six jokers. So you could store a Bitcoin key in the permutation of a Zwicker deck.<\/p>\n<p>You could also use a deck of 52 cards, plus 2 jokers, if you also consider orientation. 30 cards are rotationally symmetric, 22 are not, and neither are jokers. So, including two asymmetric jokers, you could add 24 additional bits. Permutations of a 54 card deck can encode 237 bits, and with 24 orientation bits, this is a total of 261 bits.<\/p>\n<h2>RSA<\/h2>\n<p>RSA key sizes vary, but 2048 and 3072 are common. A 2048-bit key would require a deck of 301 cards. Casinos often use a shoe of 312 cards, combining six decks of 52 cards, to deal Baccarat or Blackjack. However, casinos combine identical decks. If you were to combine six unique decks, you could store a 2048-bit key.<\/p>\n<p>Storing a 3072-bit key would require a deck of 422 cards. You could make a deck of 432 cards by combining 8 distinguishable packs of 54 cards (52 + 2 jokers).<\/p>\n<h2>ML-KEM<\/h2>\n<p>ML-KEM is a proposed quantum-resistant replacement for RSA. As with RSA, key sizes for ML-KEM vary, the smallest being ML-<strong>KEM-512<\/strong> with a key size of 1632 bytes, which equals 13056 bits. This would require a deck of 1442 cards. You could combine 28 distinct packs of 52 cards, but that&#8217;s unwieldy.<\/p>\n<p>This illustrates one of the difficult trade-offs with post-quantum cryptography: key sizes are much bigger. If you wanted to create a deck of 1442 cards, you&#8217;d probably want to make your &#8220;cards&#8221; something other than standard playing cards. You&#8217;d want to use permutations of something else.<\/p>\n<h2>Verification<\/h2>\n<p>The following Python code verifies the calculations above.<\/p>\n<pre>from math import log2, factorial, floor\r\n\r\ndef capacity(cards):\r\n    return floor(log2(factorial(cards)))\r\n\r\ndef verify(bits, cards):\r\n    return capacity(cards) &gt;= bits and capacity(cards-1) &lt; bits\r\n\r\nprint(verify(237, 54))\r\nprint(verify(256, 58))\r\nprint(verify(2048, 301))\r\nprint(verify(3072, 422))\r\nprint(verify(1632*8, 1442))\r\n<\/pre>\n<p>For more on how I came up with the deck sizes, see the <a href=\"https:\/\/www.johndcook.com\/blog\/2026\/07\/28\/inverse-factorial-improved\/\">next post<\/a> on computing the inverse factorial.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The previous post looked at the idea of storing a cryptographic key in the order of a deck of cards. A deck of 52 cards can store 225 bits of data because \u230alog2(52!)\u230b = 225. Here \u230ax\u230b is\u00a0x rounded down to the nearest integer. If we want to store bigger keys, we&#8217;re going to need [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[9],"tags":[197,43],"class_list":["post-247468","post","type-post","status-publish","format-standard","hentry","category-math","tag-combinatorics","tag-cryptography"],"acf":[],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"You can store cryptographic keys in the order of a deck of cards. How big a deck would you need to store Bitcoin, RSA, or ML-KEM keys?\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"John\"\/>\n\t<meta name=\"keywords\" content=\"combinatorics,cryptography\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.johndcook.com\/blog\/2026\/07\/28\/keys-and-cards\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"John D. Cook | Applied Mathematics Consulting\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Cryptographic Keys and Decks of Cards\" \/>\n\t\t<meta property=\"og:description\" content=\"You can store cryptographic keys in the order of a deck of cards. How big a deck would you need to store Bitcoin, RSA, or ML-KEM keys?\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.johndcook.com\/blog\/2026\/07\/28\/keys-and-cards\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2026-07-28T12:13:17+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2026-07-28T18:11:18+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Cryptographic Keys and Decks of Cards\" \/>\n\t\t<meta name=\"twitter:description\" content=\"You can store cryptographic keys in the order of a deck of cards. How big a deck would you need to store Bitcoin, RSA, or ML-KEM keys?\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Cryptographic Keys and Decks of Cards","description":"You can store cryptographic keys in the order of a deck of cards. How big a deck would you need to store Bitcoin, RSA, or ML-KEM keys?","canonical_url":"https:\/\/www.johndcook.com\/blog\/2026\/07\/28\/keys-and-cards\/","robots":"max-image-preview:large","keywords":"combinatorics,cryptography","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"John D. Cook | Applied Mathematics Consulting","og:type":"article","og:title":"Cryptographic Keys and Decks of Cards","og:description":"You can store cryptographic keys in the order of a deck of cards. How big a deck would you need to store Bitcoin, RSA, or ML-KEM keys?","og:url":"https:\/\/www.johndcook.com\/blog\/2026\/07\/28\/keys-and-cards\/","article:published_time":"2026-07-28T12:13:17+00:00","article:modified_time":"2026-07-28T18:11:18+00:00","twitter:card":"summary","twitter:title":"Cryptographic Keys and Decks of Cards","twitter:description":"You can store cryptographic keys in the order of a deck of cards. How big a deck would you need to store Bitcoin, RSA, or ML-KEM keys?","twitter:image":"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png"},"aioseo_meta_data":{"post_id":"247468","title":null,"description":"You can store cryptographic keys in the order of a deck of cards. How big a deck would you need to store Bitcoin, RSA, or ML-KEM keys?","keywords":null,"keyphrases":{"focus":[],"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"created":"2026-07-28 11:10:29","updated":"2026-08-04 10:52:24","ai":{"faqs":[],"keyPoints":[],"schemas":[],"titles":[],"descriptions":[],"socialPosts":{"email":{"subject":"","preview":"","content":""},"linkedin":[],"twitter":[],"facebook":[],"instagram":[]}},"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.johndcook.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.johndcook.com\/blog\/category\/math\/\" title=\"Math\">Math<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tCryptographic Keys and Decks of Cards\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.johndcook.com\/blog"},{"label":"Math","link":"https:\/\/www.johndcook.com\/blog\/category\/math\/"},{"label":"Cryptographic Keys and Decks of Cards","link":"https:\/\/www.johndcook.com\/blog\/2026\/07\/28\/keys-and-cards\/"}],"_links":{"self":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247468","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/comments?post=247468"}],"version-history":[{"count":4,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247468\/revisions"}],"predecessor-version":[{"id":247475,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247468\/revisions\/247475"}],"wp:attachment":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/media?parent=247468"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/categories?post=247468"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/tags?post=247468"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}]