[{"id":247278,"date":"2026-06-30T09:36:14","date_gmt":"2026-06-30T14:36:14","guid":{"rendered":"https:\/\/www.johndcook.com\/blog\/?p=247278"},"modified":"2026-06-30T09:36:14","modified_gmt":"2026-06-30T14:36:14","slug":"silver-kings","status":"publish","type":"post","link":"https:\/\/www.johndcook.com\/blog\/2026\/06\/30\/silver-kings\/","title":{"rendered":"Silver Rectangles and the Ways of Kings"},"content":{"rendered":"<h2>Golden rectangles<\/h2>\n<p>The defining property of golden rectangle is that if you stick a square on its longer side, you get another golden rectangle.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium\" src=\"https:\/\/www.johndcook.com\/golden_rectangle.png\" width=\"263\" height=\"188\" \/><\/p>\n<p>The smaller vertical rectangle is similar to the larger horizontal rectangle. This means<\/p>\n<p style=\"padding-left: 40px;\">\u03c6 \/ 1 = (1 + \u03c6) \/ \u03c6<\/p>\n<p>which tells us \u03c6\u00b2 = 1 + \u03c6 and so the golden ratio \u03c6 equals (1 + \u221a5)\/2.<\/p>\n<h2>Silver rectangles<\/h2>\n<p>A silver rectangle is one that if you stick <em>two<\/em> squares on its longer side you get another rectangle with the same aspect ratio.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-medium aligncenter\" src=\"https:\/\/www.johndcook.com\/silver_rectangle.png\" width=\"530\" height=\"254\" \/><\/p>\n<p>This tells us<\/p>\n<p style=\"padding-left: 40px;\">\u03c3 \/ 1 = (1 + 2\u03c3) \/ \u03c3<\/p>\n<p>and so \u03c3\u00b2 = 1 + 2\u03c3 and the silver ratio is \u03c3 = 1 + \u221a2.<\/p>\n<p>Just as you can define a golden ratio and a silver ratio, there&#8217;s an analogous way to define a sequence of <a href=\"https:\/\/www.johndcook.com\/blog\/2023\/04\/14\/metallic-ratios\/\">metallic ratios<\/a>.<\/p>\n<h2>Kings and Dellanoy numbers<\/h2>\n<p>The silver ratio has several connections to the ways of ways kings. By that I mean the number of ways a king can go from one corner of a chessboard to the diagonally opposite corner without backtracking.<\/p>\n<p>A king can move one space in any direction. If we start with a king in the bottom left corner of the board, the no-backtracking requirement means the king can move up, right, or up and right.<\/p>\n<p>The number of paths a king can take from one corner to the opposite corner of an <em>n<\/em> \u00d7 <em>n<\/em> chessboard is the <em>n<\/em>th central Delannoy number <em>D<\/em><sub><em>n<\/em><\/sub>. more generally Dellanoy numbers are defined for an <em>m<\/em> \u00d7 <em>n<\/em> chessboard, but I&#8217;ll stick to the case\u00a0<em>m<\/em> =\u00a0<em>n<\/em> called the\u00a0<em>central<\/em> Dellanoy number, or just Dellanoy numbers for short.<\/p>\n<p>The first Delannoy number is 1 because there&#8217;s only one way for a king to get from one corner to the other: do nothing, because the opposite corner is the same corner. The second Delannoy number is 3 because the king can move up then right, or right then up, or move diagonally up and right.<\/p>\n<p>For a 3 \u00d7 3 grid things are significantly more complicated, and <em>D<\/em><sub>3<\/sub> = 13. For an 8 \u00d7 8 grid the number of paths is 48,639.<\/p>\n<h2>Generating function<\/h2>\n<p>How would you estimate the number of paths on an <em>n<\/em> \u00d7 <em>n<\/em> board for large values of <em>n<\/em> without calculating it exactly? You might start by finding a generating function for the Delannoy numbers, which works out to be<\/p>\n<p style=\"padding-left: 40px;\">(<em>x<\/em>\u00b2 \u2212 6<em>x<\/em> + 1)<sup>\u22121\/2<\/sup><\/p>\n<p>The radius of convergence <em>r<\/em> for the generating function series is the distance from 0 to the closest singularity of the generating function, which is the smaller root of<\/p>\n<p style=\"padding-left: 40px;\"><em>x<\/em>\u00b2 \u2212 6<em>x<\/em> + 1<\/p>\n<p>which is<\/p>\n<p style=\"padding-left: 40px;\">3 \u2212 \u221a8 = (3 + \u221a8)<sup>\u22121<\/sup> = (1 + \u221a2)<sup>\u22122<\/sup> = 1\/\u03c3\u00b2<\/p>\n<p>i.e. the radius of convergence is the reciprocal of the silver ratio squared.<\/p>\n<h2>Asymptotic estimate<\/h2>\n<p>The radius of convergence gives us a first approximation to the asymptotic size of the series coefficients. Since we&#8217;re working with the generating function of the Delannoy numbers, these coefficients are the Delannoy numbers. That is,<\/p>\n<p style=\"padding-left: 40px;\"><em>D<\/em><sub><em>n<\/em><\/sub> ~ <em>r<\/em><sup>\u2212<em>n<\/em><\/sup> = (\u03c3<sup>2<\/sup>)<sup><em>n<\/em><\/sup> = \u03c3<sup>2<em>n<\/em><\/sup>.<\/p>\n<p>That&#8217;s as good as you can do just knowing the radius of convergence. A more careful analysis would refine this estimate by dividing by a factor proportional to \u221a<em>n<\/em>.<\/p>\n<h2>Related posts<\/h2>\n<ul>\n<li class='link'><a href='https:\/\/www.johndcook.com\/blog\/2009\/05\/20\/the-silver-ratio\/'>The silver ratio<\/a><\/li>\n<li class='link'><a href='https:\/\/www.johndcook.com\/blog\/2011\/04\/13\/a-magic-kings-tour\/'>A magic king&#8217;s tour<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Golden rectangles The defining property of golden rectangle is that if you stick a square on its longer side, you get another golden rectangle. The smaller vertical rectangle is similar to the larger horizontal rectangle. This means \u03c6 \/ 1 = (1 + \u03c6) \/ \u03c6 which tells us \u03c6\u00b2 = 1 + \u03c6 and [&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":[33],"class_list":["post-247278","post","type-post","status-publish","format-standard","hentry","category-math","tag-chess"],"acf":[],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.9 - aioseo.com -->\n\t<meta name=\"description\" content=\"Silver rectangles and a connection to counting the number of ways a king can move from one corner of the chessboard to the opposite corner\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"John\"\/>\n\t<meta name=\"keywords\" content=\"chess\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.johndcook.com\/blog\/2026\/06\/30\/silver-kings\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.9\" \/>\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=\"Silver Rectangles and the Ways of Kings\" \/>\n\t\t<meta property=\"og:description\" content=\"Silver rectangles and a connection to counting the number of ways a king can move from one corner of the chessboard to the opposite corner\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.johndcook.com\/blog\/2026\/06\/30\/silver-kings\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2026-06-30T14:36:14+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2026-06-30T14:36:14+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Silver Rectangles and the Ways of Kings\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Silver rectangles and a connection to counting the number of ways a king can move from one corner of the chessboard to the opposite corner\" \/>\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":"Silver Rectangles and the Ways of Kings","description":"Silver rectangles and a connection to counting the number of ways a king can move from one corner of the chessboard to the opposite corner","canonical_url":"https:\/\/www.johndcook.com\/blog\/2026\/06\/30\/silver-kings\/","robots":"max-image-preview:large","keywords":"chess","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"John D. Cook | Applied Mathematics Consulting","og:type":"article","og:title":"Silver Rectangles and the Ways of Kings","og:description":"Silver rectangles and a connection to counting the number of ways a king can move from one corner of the chessboard to the opposite corner","og:url":"https:\/\/www.johndcook.com\/blog\/2026\/06\/30\/silver-kings\/","article:published_time":"2026-06-30T14:36:14+00:00","article:modified_time":"2026-06-30T14:36:14+00:00","twitter:card":"summary","twitter:title":"Silver Rectangles and the Ways of Kings","twitter:description":"Silver rectangles and a connection to counting the number of ways a king can move from one corner of the chessboard to the opposite corner","twitter:image":"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png"},"aioseo_meta_data":{"post_id":"247278","title":null,"description":"Silver rectangles and a connection to counting the number of ways a king can move from one corner of the chessboard to the opposite corner","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-06-30 12:51:52","updated":"2026-06-30 15:45:00","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\tSilver Rectangles and the Ways of Kings\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":"Silver Rectangles and the Ways of Kings","link":"https:\/\/www.johndcook.com\/blog\/2026\/06\/30\/silver-kings\/"}],"_links":{"self":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247278","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=247278"}],"version-history":[{"count":2,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247278\/revisions"}],"predecessor-version":[{"id":247280,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247278\/revisions\/247280"}],"wp:attachment":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/media?parent=247278"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/categories?post=247278"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/tags?post=247278"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":247274,"date":"2026-06-29T20:06:12","date_gmt":"2026-06-30T01:06:12","guid":{"rendered":"https:\/\/www.johndcook.com\/blog\/?p=247274"},"modified":"2026-06-29T20:06:12","modified_gmt":"2026-06-30T01:06:12","slug":"derivative-equals-inverse","status":"publish","type":"post","link":"https:\/\/www.johndcook.com\/blog\/2026\/06\/29\/derivative-equals-inverse\/","title":{"rendered":"Derivative equals inverse"},"content":{"rendered":"<p>Here&#8217;s kind of a strange problem with an interesting solution: find a function\u00a0<em>f<\/em> such that the derivative of\u00a0<em>f<\/em> equals the inverse of\u00a0<em>f<\/em> for all positive <em>x<\/em>.<\/p>\n<p style=\"padding-left: 40px;\"><em>f<\/em>\u2009\u2032(<em>x<\/em>) =\u00a0<em>f<\/em><sup>\u22121<\/sup>(<em>x<\/em>)<\/p>\n<p>This is a differential equation, but a very unusual one, one that cannot be solved using any of the techniques taught in a class on differential equations.<\/p>\n<p>The unique solution is<\/p>\n<p style=\"padding-left: 40px;\"><em>f<\/em>(<em>x<\/em>) = \u03c6(<em>x<\/em> \/ \u03c6)<sup>\u03c6<\/sup><\/p>\n<p>where \u03c6 is the golden ratio. What an unexpected appearance of the golden ratio!<\/p>\n<p>The problem was proposed by H. L. Nelson and solved by A. C. Hindmarsh. See The American Mathematical Monthly, Vol. 76, No. 6 p. 696.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s kind of a strange problem with an interesting solution: find a function\u00a0f such that the derivative of\u00a0f equals the inverse of\u00a0f for all positive x. f\u2009\u2032(x) =\u00a0f\u22121(x) This is a differential equation, but a very unusual one, one that cannot be solved using any of the techniques taught in a class on 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":[47],"class_list":["post-247274","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 4.9.9 - aioseo.com -->\n\t<meta name=\"description\" content=\"Find a function whose derivative is its inverse.\" \/>\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\/06\/29\/derivative-equals-inverse\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.9\" \/>\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=\"Derivative equals inverse\" \/>\n\t\t<meta property=\"og:description\" content=\"Find a function whose derivative is its inverse.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.johndcook.com\/blog\/2026\/06\/29\/derivative-equals-inverse\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2026-06-30T01:06:12+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2026-06-30T01:06:12+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Derivative equals inverse\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Find a function whose derivative is its inverse.\" \/>\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":"Derivative equals inverse","description":"Find a function whose derivative is its inverse.","canonical_url":"https:\/\/www.johndcook.com\/blog\/2026\/06\/29\/derivative-equals-inverse\/","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":"Derivative equals inverse","og:description":"Find a function whose derivative is its inverse.","og:url":"https:\/\/www.johndcook.com\/blog\/2026\/06\/29\/derivative-equals-inverse\/","article:published_time":"2026-06-30T01:06:12+00:00","article:modified_time":"2026-06-30T01:06:12+00:00","twitter:card":"summary","twitter:title":"Derivative equals inverse","twitter:description":"Find a function whose derivative is its inverse.","twitter:image":"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png"},"aioseo_meta_data":{"post_id":"247274","title":null,"description":"Find a function whose derivative is its inverse.","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-06-30 00:39:55","updated":"2026-06-30 09:26:58","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\tDerivative equals inverse\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":"Derivative equals inverse","link":"https:\/\/www.johndcook.com\/blog\/2026\/06\/29\/derivative-equals-inverse\/"}],"_links":{"self":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247274","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=247274"}],"version-history":[{"count":3,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247274\/revisions"}],"predecessor-version":[{"id":247277,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247274\/revisions\/247277"}],"wp:attachment":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/media?parent=247274"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/categories?post=247274"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/tags?post=247274"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":247268,"date":"2026-06-29T07:12:05","date_gmt":"2026-06-29T12:12:05","guid":{"rendered":"https:\/\/www.johndcook.com\/blog\/?p=247268"},"modified":"2026-06-29T12:10:59","modified_gmt":"2026-06-29T17:10:59","slug":"who-you-gonna-believe","status":"publish","type":"post","link":"https:\/\/www.johndcook.com\/blog\/2026\/06\/29\/who-you-gonna-believe\/","title":{"rendered":"Who you gonna believe: Grok or the docs?"},"content":{"rendered":"<p>The calculator utility <code>bc<\/code> has a minimal math library. For example, there&#8217;s no tangent function because you&#8217;re expected take the ratio of sine and cosine. (The Gnu version of <code>bc<\/code> does have a function for tangent, but the POSIX version does not.) And yet <code>bc<\/code> includes support for Bessel functions <em>J<\/em>(<em>x<\/em>).<\/p>\n<p>The <code>bc<\/code> function <code>j<\/code> takes two arguments. Is the first argument <em>n<\/em> or <em>x<\/em>? Grok said the function arguments are <code>j(n,x)<\/code>. I thought I should run <code>man bc<\/code> just to make sure, and it said<\/p>\n<blockquote><p>j(x, n) Returns the bessel integer order n (truncated) of x.<\/p><\/blockquote>\n<p>So Grok says <code>j(n,x)<\/code> and the documentation that ships with the software says <code>j(x,n)<\/code>. Which one should you believe? Neither! You should run a little test.<\/p>\n<pre>~$ bc -l\r\n&gt;&gt;&gt; j(1, 0)\r\n0\r\n&gt;&gt;&gt; j(0, 1)\r\n.76519768655796655144\r\n<\/pre>\n<p>Now <em>J<\/em><sub>1<\/sub>(0) = 0, so apparently the first argument is the order <em>n<\/em>. Grok was right and the man page was wrong.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium\" src=\"https:\/\/www.johndcook.com\/who_you_gonna_believe.jpeg\" alt=\"Groucho Marx saysing \" width=\"480\" height=\"349\" \/><\/p>\n<p>As further confirmation, let&#8217;s see which argument is truncated.<\/p>\n<pre>&gt;&gt;&gt; j(1.2, 3.4)\r\n.17922585168150711099\r\n&gt;&gt;&gt; j(1, 3.4)\r\n.17922585168150711099\r\n&gt;&gt;&gt; j(1.2, 3)\r\n.33905895852593645892\r\n<\/pre>\n<p>The first argument is truncated to an integer value, so that&#8217;s the order <em>n<\/em>.<\/p>\n<p>Turns out there&#8217;s a bug in the man page. The man page text above comes from running <code>man bc<\/code> on my Macbook. On my Linux box, the documentation is correct. It says<\/p>\n<blockquote><p>j(n,x) The Bessel function of integer order n of x.<\/p><\/blockquote>\n<p>The software produces the same results on both computers. It&#8217;s just a documentation bug.<\/p>\n<p>The version running on my Macbook is the version that ships with the OS. It&#8217;s not the Gnu version, though the documentation says &#8220;This bc is compatible with both the GNU bc and the POSIX bc spec.&#8221; It has a function <code>t<\/code> for tangent, for example, which a POSIX version does not. But if you run <code>bc --standard -l<\/code> attempting to call <code>t<\/code> produces an error.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The calculator utility bc has a minimal math library. For example, there&#8217;s no tangent function because you&#8217;re expected take the ratio of sine and cosine. (The Gnu version of bc does have a function for tangent, but the POSIX version does not.) And yet bc includes support for Bessel functions J(x). The bc function j [&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":[5],"tags":[],"class_list":["post-247268","post","type-post","status-publish","format-standard","hentry","category-computing"],"acf":[],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.9 - aioseo.com -->\n\t<meta name=\"description\" content=\"When AI and the software docs conflict, which will you believe? How to decide?\" \/>\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\/06\/29\/who-you-gonna-believe\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.9\" \/>\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=\"Who you gonna believe: Grok or the docs?\" \/>\n\t\t<meta property=\"og:description\" content=\"When AI and the software docs conflict, which will you believe? How to decide?\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.johndcook.com\/blog\/2026\/06\/29\/who-you-gonna-believe\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2026-06-29T12:12:05+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2026-06-29T17:10:59+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Who you gonna believe: Grok or the docs?\" \/>\n\t\t<meta name=\"twitter:description\" content=\"When AI and the software docs conflict, which will you believe? How to decide?\" \/>\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":"Who you gonna believe: Grok or the docs?","description":"When AI and the software docs conflict, which will you believe? How to decide?","canonical_url":"https:\/\/www.johndcook.com\/blog\/2026\/06\/29\/who-you-gonna-believe\/","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":"Who you gonna believe: Grok or the docs?","og:description":"When AI and the software docs conflict, which will you believe? How to decide?","og:url":"https:\/\/www.johndcook.com\/blog\/2026\/06\/29\/who-you-gonna-believe\/","article:published_time":"2026-06-29T12:12:05+00:00","article:modified_time":"2026-06-29T17:10:59+00:00","twitter:card":"summary","twitter:title":"Who you gonna believe: Grok or the docs?","twitter:description":"When AI and the software docs conflict, which will you believe? How to decide?","twitter:image":"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png"},"aioseo_meta_data":{"post_id":"247268","title":null,"description":"When AI and the software docs conflict, which will you believe? How to decide?","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-06-29 11:12:27","updated":"2026-06-29 17:10:59","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\/computing\/\" title=\"Computing\">Computing<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tWho you gonna believe: Grok or the docs?\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.johndcook.com\/blog"},{"label":"Computing","link":"https:\/\/www.johndcook.com\/blog\/category\/computing\/"},{"label":"Who you gonna believe: Grok or the docs?","link":"https:\/\/www.johndcook.com\/blog\/2026\/06\/29\/who-you-gonna-believe\/"}],"_links":{"self":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247268","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=247268"}],"version-history":[{"count":5,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247268\/revisions"}],"predecessor-version":[{"id":247273,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247268\/revisions\/247273"}],"wp:attachment":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/media?parent=247268"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/categories?post=247268"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/tags?post=247268"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":247263,"date":"2026-06-27T19:33:33","date_gmt":"2026-06-28T00:33:33","guid":{"rendered":"https:\/\/www.johndcook.com\/blog\/?p=247263"},"modified":"2026-06-27T19:33:33","modified_gmt":"2026-06-28T00:33:33","slug":"brace-expansion-tree","status":"publish","type":"post","link":"https:\/\/www.johndcook.com\/blog\/2026\/06\/27\/brace-expansion-tree\/","title":{"rendered":"Brace expansion tree"},"content":{"rendered":"<p>Here&#8217;s a crazy bash one-liner I found via an <a href=\"https:\/\/catonmat.net\/bash-one-liners-explained-part-two\">article<\/a> by Peter Krumins:<\/p>\n<pre>echo {w,t,}h{e{n{,ce{,forth}},re{,in,fore,with{,al}}},ither,at}<\/pre>\n<p>This prints 30 English words:<\/p>\n<blockquote><p>when, whence, whenceforth, where, wherein, wherefore, wherewith, wherewithal, whither, what, then, thence, thenceforth, there, therein, therefore, therewith, therewithal, thither, that, hen, hence, henceforth, here, herein, herefore, herewith, herewithal, hither, hat<\/p><\/blockquote>\n<p>This post will explain how the one-liner works.<\/p>\n<p>Bash brace expansion iterates through all possibilities listed within curly braces, with possibilities separated by a comma. Note that the comma is a\u00a0<em>separator<\/em> and not a\u00a0<em>terminator<\/em>. And so, for example, the expression <code>{w,t,}<\/code> is effectively <code>{w,t,\"\"}<\/code>.<\/p>\n<p>When bash sees two brace expressions, these expand to the cartesian product of the two expressions. For example,<\/p>\n<pre>echo {A,B}{1,2,3}<\/pre>\n<p>produces<\/p>\n<pre>A1 A2 A3 B1 B2 B3<\/pre>\n<p>In the expression above we have<\/p>\n<pre>{w,t,}h{e\u2026,ither,at}<\/pre>\n<p>So the expansion will enumerate all possibilities of <code>{w,h,}<\/code> multiplied by all possibilities of <code>{e\u2026,ither,at}<\/code> where <code>e\u2026<\/code> is itself a brace expression.<\/p>\n<p>A diagram will help a lot.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.johndcook.com\/krumins_brace.png\" width=\"480\" height=\"407\" class=\"aligncenter size-medium\" \/><\/p>\n<p>The brace expansion does a depth-first traversal of this tree.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s a crazy bash one-liner I found via an article by Peter Krumins: echo {w,t,}h{e{n{,ce{,forth}},re{,in,fore,with{,al}}},ither,at} This prints 30 English words: when, whence, whenceforth, where, wherein, wherefore, wherewith, wherewithal, whither, what, then, thence, thenceforth, there, therein, therefore, therewith, therewithal, thither, that, hen, hence, henceforth, here, herein, herefore, herewith, herewithal, hither, hat This post will explain how [&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":[5],"tags":[],"class_list":["post-247263","post","type-post","status-publish","format-standard","hentry","category-computing"],"acf":[],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.9 - aioseo.com -->\n\t<meta name=\"description\" content=\"Bash brace expansions can be very expressive. This post walks through an example by Peter Krumins that expands to 30 English words.\" \/>\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\/06\/27\/brace-expansion-tree\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.9\" \/>\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=\"Brace expansion tree\" \/>\n\t\t<meta property=\"og:description\" content=\"Bash brace expansions can be very expressive. This post walks through an example by Peter Krumins that expands to 30 English words.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.johndcook.com\/blog\/2026\/06\/27\/brace-expansion-tree\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2026-06-28T00:33:33+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2026-06-28T00:33:33+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Brace expansion tree\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Bash brace expansions can be very expressive. This post walks through an example by Peter Krumins that expands to 30 English words.\" \/>\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":"Brace expansion tree","description":"Bash brace expansions can be very expressive. This post walks through an example by Peter Krumins that expands to 30 English words.","canonical_url":"https:\/\/www.johndcook.com\/blog\/2026\/06\/27\/brace-expansion-tree\/","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":"Brace expansion tree","og:description":"Bash brace expansions can be very expressive. This post walks through an example by Peter Krumins that expands to 30 English words.","og:url":"https:\/\/www.johndcook.com\/blog\/2026\/06\/27\/brace-expansion-tree\/","article:published_time":"2026-06-28T00:33:33+00:00","article:modified_time":"2026-06-28T00:33:33+00:00","twitter:card":"summary","twitter:title":"Brace expansion tree","twitter:description":"Bash brace expansions can be very expressive. This post walks through an example by Peter Krumins that expands to 30 English words.","twitter:image":"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png"},"aioseo_meta_data":{"post_id":"247263","title":null,"description":"Bash brace expansions can be very expressive. This post walks through an example by Peter Krumins that expands to 30 English words.","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-06-27 22:50:00","updated":"2026-06-29 10:09:57","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\/computing\/\" title=\"Computing\">Computing<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tBrace expansion tree\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.johndcook.com\/blog"},{"label":"Computing","link":"https:\/\/www.johndcook.com\/blog\/category\/computing\/"},{"label":"Brace expansion tree","link":"https:\/\/www.johndcook.com\/blog\/2026\/06\/27\/brace-expansion-tree\/"}],"_links":{"self":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247263","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=247263"}],"version-history":[{"count":3,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247263\/revisions"}],"predecessor-version":[{"id":247266,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247263\/revisions\/247266"}],"wp:attachment":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/media?parent=247263"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/categories?post=247263"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/tags?post=247263"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":247260,"date":"2026-06-27T13:12:03","date_gmt":"2026-06-27T18:12:03","guid":{"rendered":"https:\/\/www.johndcook.com\/blog\/?p=247260"},"modified":"2026-06-29T05:10:30","modified_gmt":"2026-06-29T10:10:30","slug":"decimal-period","status":"publish","type":"post","link":"https:\/\/www.johndcook.com\/blog\/2026\/06\/27\/decimal-period\/","title":{"rendered":"When will the decimals in a\/b repeat?"},"content":{"rendered":"<p>The previous post looked at how many digits are in the reduced fraction for the\u00a0<em>n<\/em>th harmonic number. I was curious about how long the cycle of digits in a harmonic number might be.<\/p>\n<p>I wrote about the period length for the digits of fractions <a href=\"https:\/\/www.johndcook.com\/blog\/2016\/10\/18\/periods-of-fractions\/\">almost a decade ago<\/a>. This post includes code so I can apply it to harmonic denominators.<\/p>\n<pre>\r\nfrom sympy import lcm, factorint, n_order\r\n\r\ndef period(n):\r\n    factors = factorint(n)\r\n    exp2 = factors.get(2, 0)\r\n    exp5 = factors.get(5, 0)\r\n    r = max(exp2, exp5)\r\n\r\n    d = n \/\/ (2**exp2 * 5**exp5)\r\n    s = 1 if d == 1 else n_order(10, d)\r\n    return (r, s)\r\n<\/pre>\n<p>This function returns two numbers: <em>r<\/em> is the number of non-repeating digits at the beginning and <em>s<\/em> is the length of the repeating part. <\/p>\n<p>The following code<\/p>\n<pre>\r\nfrom functools import reduce\r\n\r\ndef lcm_range(n):\r\n    return reduce(lcm, range(1, n + 1))\r\n\r\nprint( period( lcm_range(50) ) )\r\n<\/pre>\n<p>prints (5, 1275120) meaning that 1\/lcm(1, 2, 3, &hellip;, 49, 50) has five non-repeating digits following by 1,275,120 digits that repeat <em>ad infinitum<\/em>. And so the decimals in the expansion of <em>H<\/em><sub>50<\/sub> have a cycle length of 1,275,120.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The previous post looked at how many digits are in the reduced fraction for the\u00a0nth harmonic number. I was curious about how long the cycle of digits in a harmonic number might be. I wrote about the period length for the digits of fractions almost a decade ago. This post includes code so I can [&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-247260","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 4.9.9 - aioseo.com -->\n\t<meta name=\"description\" content=\"How to find out the length of the cycle of repeating digits in a fraction a\/b when b is so large that just computing a\/b and looking isn&#039;t practical.\" \/>\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\/06\/27\/decimal-period\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.9\" \/>\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=\"When will the decimals in a\/b repeat?\" \/>\n\t\t<meta property=\"og:description\" content=\"How to find out the length of the cycle of repeating digits in a fraction a\/b when b is so large that just computing a\/b and looking isn&#039;t practical.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.johndcook.com\/blog\/2026\/06\/27\/decimal-period\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2026-06-27T18:12:03+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2026-06-29T10:10:30+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"When will the decimals in a\/b repeat?\" \/>\n\t\t<meta name=\"twitter:description\" content=\"How to find out the length of the cycle of repeating digits in a fraction a\/b when b is so large that just computing a\/b and looking isn&#039;t practical.\" \/>\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":"When will the decimals in a\/b repeat?","description":"How to find out the length of the cycle of repeating digits in a fraction a\/b when b is so large that just computing a\/b and looking isn't practical.","canonical_url":"https:\/\/www.johndcook.com\/blog\/2026\/06\/27\/decimal-period\/","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":"When will the decimals in a\/b repeat?","og:description":"How to find out the length of the cycle of repeating digits in a fraction a\/b when b is so large that just computing a\/b and looking isn't practical.","og:url":"https:\/\/www.johndcook.com\/blog\/2026\/06\/27\/decimal-period\/","article:published_time":"2026-06-27T18:12:03+00:00","article:modified_time":"2026-06-29T10:10:30+00:00","twitter:card":"summary","twitter:title":"When will the decimals in a\/b repeat?","twitter:description":"How to find out the length of the cycle of repeating digits in a fraction a\/b when b is so large that just computing a\/b and looking isn't practical.","twitter:image":"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png"},"aioseo_meta_data":{"post_id":"247260","title":null,"description":"How to find out the length of the cycle of repeating digits in a fraction a\/b when b is so large that just computing a\/b and looking isn't practical.","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-06-27 17:57:22","updated":"2026-06-29 10:11:01","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\tWhen will the decimals in a\/b repeat?\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":"When will the decimals in a\/b repeat?","link":"https:\/\/www.johndcook.com\/blog\/2026\/06\/27\/decimal-period\/"}],"_links":{"self":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247260","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=247260"}],"version-history":[{"count":3,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247260\/revisions"}],"predecessor-version":[{"id":247267,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247260\/revisions\/247267"}],"wp:attachment":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/media?parent=247260"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/categories?post=247260"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/tags?post=247260"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":247253,"date":"2026-06-27T07:51:42","date_gmt":"2026-06-27T12:51:42","guid":{"rendered":"https:\/\/www.johndcook.com\/blog\/?p=247253"},"modified":"2026-06-27T07:51:42","modified_gmt":"2026-06-27T12:51:42","slug":"height-of-harmonic-numbers","status":"publish","type":"post","link":"https:\/\/www.johndcook.com\/blog\/2026\/06\/27\/height-of-harmonic-numbers\/","title":{"rendered":"Height of harmonic numbers"},"content":{"rendered":"<p>The <a href=\"https:\/\/www.johndcook.com\/blog\/2026\/06\/26\/writing-down-harmonic-numbers\/\">previous post<\/a> looked at writing the harmonic numbers as reduced fractions and estimating the number of digits in the numerator and denominator based on asymptotics. This is a follow up post with plots.<\/p>\n<p>We&#8217;ll choose our base\u00a0<em>b<\/em> to be 2. And we&#8217;ll look at the total number of bits in both the numerator and denominator, which we will use as the <a href=\"https:\/\/www.johndcook.com\/blog\/2023\/09\/17\/rational-height-functions\/\">height<\/a> of the fractions.<\/p>\n<p>First, let&#8217;s look at the actual and estimated heights, using the estimates from the previous post.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium\" src=\"https:\/\/www.johndcook.com\/harmonic_height1.png\" width=\"480\" height=\"360\" \/><\/p>\n<p>Next let&#8217;s look at the difference between the actual and estimated heights.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium\" src=\"https:\/\/www.johndcook.com\/harmonic_height2.png\" width=\"480\" height=\"360\" \/><\/p>\n<p>In the previous post I looked at <em>n<\/em> = 50, which was kind of a lucky choice, the error being smaller than usual. I had also looked at, but didn&#8217;t publish, <em>n<\/em> = 100, which would be an unlucky choice.<\/p>\n<p>Finally, let&#8217;s look at the <em>relative<\/em> error in the estimates, and plot over a larger range of <em>n<\/em>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium\" src=\"https:\/\/www.johndcook.com\/harmonic_height3.png\" width=\"480\" height=\"360\" \/><\/p>\n<p>The error goes to zero, as predicted by the asymptotic estimates. And it goes noisily, which you&#8217;d expect since the heights are related to the distribution of primes.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The previous post looked at writing the harmonic numbers as reduced fractions and estimating the number of digits in the numerator and denominator based on asymptotics. This is a follow up post with plots. We&#8217;ll choose our base\u00a0b to be 2. And we&#8217;ll look at the total number of bits in both the numerator and [&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-247253","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 4.9.9 - aioseo.com -->\n\t<meta name=\"description\" content=\"Plotting the actual and estimated number of bits in the nth harmonic number.\" \/>\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\/06\/27\/height-of-harmonic-numbers\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.9\" \/>\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=\"Height of harmonic numbers\" \/>\n\t\t<meta property=\"og:description\" content=\"Plotting the actual and estimated number of bits in the nth harmonic number.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.johndcook.com\/blog\/2026\/06\/27\/height-of-harmonic-numbers\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2026-06-27T12:51:42+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2026-06-27T12:51:42+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Height of harmonic numbers\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Plotting the actual and estimated number of bits in the nth harmonic number.\" \/>\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":"Height of harmonic numbers","description":"Plotting the actual and estimated number of bits in the nth harmonic number.","canonical_url":"https:\/\/www.johndcook.com\/blog\/2026\/06\/27\/height-of-harmonic-numbers\/","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":"Height of harmonic numbers","og:description":"Plotting the actual and estimated number of bits in the nth harmonic number.","og:url":"https:\/\/www.johndcook.com\/blog\/2026\/06\/27\/height-of-harmonic-numbers\/","article:published_time":"2026-06-27T12:51:42+00:00","article:modified_time":"2026-06-27T12:51:42+00:00","twitter:card":"summary","twitter:title":"Height of harmonic numbers","twitter:description":"Plotting the actual and estimated number of bits in the nth harmonic number.","twitter:image":"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png"},"aioseo_meta_data":{"post_id":"247253","title":null,"description":"Plotting the actual and estimated number of bits in the nth harmonic number.","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-06-27 12:35:46","updated":"2026-06-27 17:57:48","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\tHeight of harmonic numbers\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":"Height of harmonic numbers","link":"https:\/\/www.johndcook.com\/blog\/2026\/06\/27\/height-of-harmonic-numbers\/"}],"_links":{"self":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247253","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=247253"}],"version-history":[{"count":4,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247253\/revisions"}],"predecessor-version":[{"id":247257,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247253\/revisions\/247257"}],"wp:attachment":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/media?parent=247253"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/categories?post=247253"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/tags?post=247253"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":247251,"date":"2026-06-26T20:51:03","date_gmt":"2026-06-27T01:51:03","guid":{"rendered":"https:\/\/www.johndcook.com\/blog\/?p=247251"},"modified":"2026-06-27T07:59:00","modified_gmt":"2026-06-27T12:59:00","slug":"writing-down-harmonic-numbers","status":"publish","type":"post","link":"https:\/\/www.johndcook.com\/blog\/2026\/06\/26\/writing-down-harmonic-numbers\/","title":{"rendered":"Writing down harmonic numbers"},"content":{"rendered":"<p>The\u00a0<em>n<\/em>th harmonic number is the sum of the reciprocals of the first\u00a0<em>n<\/em> positive integers.<\/p>\n<p style=\"padding-left: 40px;\"><em>H<\/em><sub><em>n<\/em><\/sub> = 1 + 1\/2 + 1\/3 + 1\/4 + \u2026 + 1\/<em>n<\/em><\/p>\n<p>The product of all the denominators is\u00a0<em>n<\/em>!, so you could write <em>H<\/em><sub><em>n<\/em><\/sub> as a fraction<\/p>\n<p style=\"padding-left: 40px;\"><em>H<\/em><sub><em>n<\/em><\/sub> = <em>p<\/em>\/<em>q<\/em><\/p>\n<p>where\u00a0<em>p<\/em> =\u00a0<em>n<\/em>! <em>H<\/em><sub><em>n<\/em><\/sub> is an integer and <em>q<\/em> =\u00a0<em>n<\/em>!.<\/p>\n<p>While <em>p<\/em>\/<em>q<\/em>\u00a0is <em>a<\/em> way to write <em>H<\/em><sub><em>n<\/em><\/sub> as a fraction, it&#8217;s not the most efficient because\u00a0<em>p<\/em> and\u00a0<em>n<\/em>! will have common factors.<\/p>\n<p>If we write <em>H<\/em><sub><em>n<\/em><\/sub> as a reduced fraction, the denominator will be the least common multiple of the integers 1 through\u00a0<em>n<\/em>. That number is asymptotically exp(<em>n<\/em>). That estimate follows from the prime number theorem.<\/p>\n<p>So for large <em>n<\/em> the denominator will be roughly exp(<em>n<\/em>), and in base\u00a0<em>b<\/em> it would have around<\/p>\n<p style=\"padding-left: 40px;\"><span style=\"background-color: #dee;\"><em>n<\/em>\/log(<em>b<\/em>)<\/span><\/p>\n<p>digits.<\/p>\n<p>The numerator will be exp(<em>n<\/em>) <em>H<\/em><sub><em>n<\/em><\/sub>, and since <em>H<\/em><sub><em>n<\/em><\/sub> is asymptotically log(<em>n<\/em>) + \u03b3, the numerator for large\u00a0<em>n<\/em> will be roughly<\/p>\n<p style=\"padding-left: 40px;\">exp(<em>n<\/em>) (log(<em>n<\/em>) + \u03b3)<\/p>\n<p>and will have around<\/p>\n<p style=\"padding-left: 40px;\"><span style=\"background-color: #dee;\">(<em>n<\/em> + log log(<em>n<\/em>) ) \/ log(<em>b<\/em>)<\/span><\/p>\n<p>digits.<\/p>\n<p>Let&#8217;s see how well our asymptotic estimates work for\u00a0<em>n<\/em> = 50. The 50th harmonic number is<\/p>\n<p style=\"padding-left: 40px;\"><em>H<\/em><sub>50<\/sub> = 13943237577224054960759 \/ 3099044504245996706400.<\/p>\n<p>This fraction has 23 digits in the numerator and 22 in the denominator. We would have predicted around<\/p>\n<p style=\"padding-left: 40px;\">(50 + log(log(50)))\/log(10) = 22.3<\/p>\n<p>digits in the numerator and<\/p>\n<p style=\"padding-left: 40px;\">50\/log(10) = 21.7<\/p>\n<p>digits in the denominator.<\/p>\n<p>Let&#8217;s try a larger example, looking at the 1000th harmonic number in binary. We&#8217;ll use the following Python code.<\/p>\n<pre>from fractions import Fraction\r\n\r\ndef bits(n):\r\n    H = sum(Fraction(i, i+1) for i in range(1, n+1))\r\n    p, q = H.numerator, H.denominator\r\n    # subtract 2 because bin returns a string starting with 0b.\r\n    return len(bin(p)) - 2, len(bin(q)) - 2\r\n\r\nprint(bits(1000))\r\n<\/pre>\n<p>This returns 1448 and 1438. We would have estimated<\/p>\n<p style=\"padding-left: 40px;\">(1000 + log(log(1000)))\/log(2) = 1445.4<\/p>\n<p>bits in the numerator and<\/p>\n<p style=\"padding-left: 40px;\">1000\/log(2) = 1442.7<\/p>\n<p>bits in the denominator.<\/p>\n<p><strong>Update<\/strong>: See the <a href=\"https:\/\/www.johndcook.com\/blog\/2026\/06\/27\/height-of-harmonic-numbers\/\">next post<\/a> for plots as a function of\u00a0<em>n<\/em>.<\/p>\n<h2>Related posts<\/h2>\n<ul>\n<li class=\"link\"><a href=\"https:\/\/www.johndcook.com\/blog\/2017\/04\/18\/computing-harmonic-numbers\/\">Computing harmonic numbers<\/a><\/li>\n<li class=\"link\"><a href=\"https:\/\/www.johndcook.com\/blog\/2021\/01\/23\/sums-of-consecutive-reciprocals\/\">Sums of consecutive reciprocals<\/a><\/li>\n<li class=\"link\"><a href=\"https:\/\/www.johndcook.com\/blog\/2023\/05\/23\/am-over-gm\/\">AM over GM<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>The\u00a0nth harmonic number is the sum of the reciprocals of the first\u00a0n positive integers. Hn = 1 + 1\/2 + 1\/3 + 1\/4 + \u2026 + 1\/n The product of all the denominators is\u00a0n!, so you could write Hn as a fraction Hn = p\/q where\u00a0p =\u00a0n! Hn is an integer and q =\u00a0n!. While [&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-247251","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 4.9.9 - aioseo.com -->\n\t<meta name=\"description\" content=\"The nth harmonic number can be written as a fraction. How would you predict the number of digits in the numerator and denominator as a function of n?\" \/>\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\/06\/26\/writing-down-harmonic-numbers\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.9\" \/>\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=\"Writing down harmonic numbers\" \/>\n\t\t<meta property=\"og:description\" content=\"The nth harmonic number can be written as a fraction. How would you predict the number of digits in the numerator and denominator as a function of n?\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.johndcook.com\/blog\/2026\/06\/26\/writing-down-harmonic-numbers\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2026-06-27T01:51:03+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2026-06-27T12:59:00+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Writing down harmonic numbers\" \/>\n\t\t<meta name=\"twitter:description\" content=\"The nth harmonic number can be written as a fraction. How would you predict the number of digits in the numerator and denominator as a function of n?\" \/>\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":"Writing down harmonic numbers","description":"The nth harmonic number can be written as a fraction. How would you predict the number of digits in the numerator and denominator as a function of n?","canonical_url":"https:\/\/www.johndcook.com\/blog\/2026\/06\/26\/writing-down-harmonic-numbers\/","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":"Writing down harmonic numbers","og:description":"The nth harmonic number can be written as a fraction. How would you predict the number of digits in the numerator and denominator as a function of n?","og:url":"https:\/\/www.johndcook.com\/blog\/2026\/06\/26\/writing-down-harmonic-numbers\/","article:published_time":"2026-06-27T01:51:03+00:00","article:modified_time":"2026-06-27T12:59:00+00:00","twitter:card":"summary","twitter:title":"Writing down harmonic numbers","twitter:description":"The nth harmonic number can be written as a fraction. How would you predict the number of digits in the numerator and denominator as a function of n?","twitter:image":"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png"},"aioseo_meta_data":{"post_id":"247251","title":null,"description":"The nth harmonic number can be written as a fraction. How would you predict the number of digits in the numerator and denominator as a function of n?","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-06-27 00:49:27","updated":"2026-06-27 17:57:48","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\tWriting down harmonic numbers\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":"Writing down harmonic numbers","link":"https:\/\/www.johndcook.com\/blog\/2026\/06\/26\/writing-down-harmonic-numbers\/"}],"_links":{"self":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247251","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=247251"}],"version-history":[{"count":2,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247251\/revisions"}],"predecessor-version":[{"id":247258,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247251\/revisions\/247258"}],"wp:attachment":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/media?parent=247251"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/categories?post=247251"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/tags?post=247251"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":247249,"date":"2026-06-25T14:20:09","date_gmt":"2026-06-25T19:20:09","guid":{"rendered":"https:\/\/www.johndcook.com\/blog\/?p=247249"},"modified":"2026-06-25T14:20:09","modified_gmt":"2026-06-25T19:20:09","slug":"harts-theorem","status":"publish","type":"post","link":"https:\/\/www.johndcook.com\/blog\/2026\/06\/25\/harts-theorem\/","title":{"rendered":"Hart&#8217;s theorem"},"content":{"rendered":"<p>Hart&#8217;s theorem says<\/p>\n<blockquote><p>If a triangle be formed by the arcs of three circles, the inscribed and the three escribed circles are all tangent to a new circle or line.<\/p><\/blockquote>\n<p>Here &#8220;triangle&#8221; means a three-sided figure whose sides are portions of a circle. The inscribed circle is the largest circle that can fit inside the three-sided figure.<\/p>\n<p>The &#8220;escribed&#8221; circles are analogous to the excircles in the <a href=\"https:\/\/www.johndcook.com\/blog\/2026\/06\/25\/incircle-excircle\/\">previous post<\/a>: you extend two sides and find a circle that is tangent to the triangle side and the extended side. The difference here being that the side extensions are now circles.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium\" src=\"https:\/\/www.johndcook.com\/hart_circles.png\" width=\"400\" height=\"466\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hart&#8217;s theorem says If a triangle be formed by the arcs of three circles, the inscribed and the three escribed circles are all tangent to a new circle or line. Here &#8220;triangle&#8221; means a three-sided figure whose sides are portions of a circle. The inscribed circle is the largest circle that can fit inside 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":[224],"class_list":["post-247249","post","type-post","status-publish","format-standard","hentry","category-math","tag-geometry"],"acf":[],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.9 - aioseo.com -->\n\t<meta name=\"description\" content=\"Hart&#039;s theorem for three-sided figures made of circular arcs.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"John\"\/>\n\t<meta name=\"keywords\" content=\"geometry\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.johndcook.com\/blog\/2026\/06\/25\/harts-theorem\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.9\" \/>\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=\"Hart\u2019s theorem\" \/>\n\t\t<meta property=\"og:description\" content=\"Hart&#039;s theorem for three-sided figures made of circular arcs.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.johndcook.com\/blog\/2026\/06\/25\/harts-theorem\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2026-06-25T19:20:09+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2026-06-25T19:20:09+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Hart\u2019s theorem\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Hart&#039;s theorem for three-sided figures made of circular arcs.\" \/>\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":"Hart\u2019s theorem","description":"Hart's theorem for three-sided figures made of circular arcs.","canonical_url":"https:\/\/www.johndcook.com\/blog\/2026\/06\/25\/harts-theorem\/","robots":"max-image-preview:large","keywords":"geometry","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"John D. Cook | Applied Mathematics Consulting","og:type":"article","og:title":"Hart\u2019s theorem","og:description":"Hart's theorem for three-sided figures made of circular arcs.","og:url":"https:\/\/www.johndcook.com\/blog\/2026\/06\/25\/harts-theorem\/","article:published_time":"2026-06-25T19:20:09+00:00","article:modified_time":"2026-06-25T19:20:09+00:00","twitter:card":"summary","twitter:title":"Hart\u2019s theorem","twitter:description":"Hart's theorem for three-sided figures made of circular arcs.","twitter:image":"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png"},"aioseo_meta_data":{"post_id":"247249","title":null,"description":"Hart's theorem for three-sided figures made of circular arcs.","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-06-25 18:13:38","updated":"2026-06-25 23:41:57","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\tHart\u2019s theorem\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":"Hart&#8217;s theorem","link":"https:\/\/www.johndcook.com\/blog\/2026\/06\/25\/harts-theorem\/"}],"_links":{"self":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247249","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=247249"}],"version-history":[{"count":1,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247249\/revisions"}],"predecessor-version":[{"id":247250,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247249\/revisions\/247250"}],"wp:attachment":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/media?parent=247249"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/categories?post=247249"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/tags?post=247249"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":247245,"date":"2026-06-25T09:35:52","date_gmt":"2026-06-25T14:35:52","guid":{"rendered":"https:\/\/www.johndcook.com\/blog\/?p=247245"},"modified":"2026-06-25T09:35:52","modified_gmt":"2026-06-25T14:35:52","slug":"incircle-excircle","status":"publish","type":"post","link":"https:\/\/www.johndcook.com\/blog\/2026\/06\/25\/incircle-excircle\/","title":{"rendered":"Incircles and Excircles of Pythagorean triangles"},"content":{"rendered":"<p>This post will reveal the connection between my two previous posts: one on the <a href=\"https:\/\/www.johndcook.com\/blog\/2026\/06\/24\/star-trek-lemma\/\">Star Trek lemma<\/a> and one on <a href=\"https:\/\/www.johndcook.com\/blog\/2026\/06\/25\/consecutive-pythagorean\/\">Pythagorean triples<\/a>.<\/p>\n<p>In the process of writing the latter, I looked at the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Pythagorean_triple\">Wikipedia article<\/a> on Pythagorean triples and noticed this curious paragraph.<\/p>\n<blockquote><p>In every Pythagorean triangle, the radius of the\u00a0incircle\u00a0and the radii of the three\u00a0excircles\u00a0are positive integers. Specifically, for a primitive triple the radius of the incircle is\u00a0<i>r<\/i>\u00a0=\u00a0<i>n<\/i>(<i>m<\/i>\u00a0\u2212\u00a0<i>n<\/i>), and the radii of the excircles opposite the sides\u00a0<i>m<\/i><sup>2<\/sup>\u00a0\u2212\u00a0<i>n<sup>2<\/sup><\/i>,\u00a0<i>2mn<\/i>, and the hypotenuse <i>m<\/i><sup>2<\/sup>\u00a0+\u00a0<i>n<\/i><sup>2<\/sup>\u00a0are respectively\u00a0<i>m<\/i>(<i>m<\/i>\u00a0\u2212\u00a0<i>n<\/i>),\u00a0<i>n<\/i>(<i>m<\/i>\u00a0+\u00a0<i>n<\/i>), and <em>m<\/em>(<i>m<\/i>\u00a0+\u00a0<i>n<\/i>).<\/p><\/blockquote>\n<p>The citation for the paragraph above was the book by my former officemate, which led to the post on the Star Trek lemma. The passage in Arthur Baragar&#8217;s book that Wikipedia cites is Exercise 15.3.<\/p>\n<blockquote><p>Let \u0394<em>ABC<\/em> be a right angle triangle with sides of integer length. Prove that the inradius <em>r<\/em> and the exradii <em>r<\/em><sub><em>a<\/em><\/sub>, <em>r<\/em><sub><em>b<\/em><\/sub>, and <em>r<\/em><sub><em>c<\/em><\/sub> are all integers.<\/p><\/blockquote>\n<p>I don&#8217;t know whether Arthur discovered this theorem, but I&#8217;ll call it Baragar&#8217;s theorem for this post.<\/p>\n<h2>Incircles and excircles<\/h2>\n<p>To unpack Baragar&#8217;s theorem, let&#8217;s start by saying what <a href=\"https:\/\/www.johndcook.com\/blog\/2022\/11\/26\/incircle-and-excircles\/\">incircles and excircles<\/a> are. Incircles are more familiar. The\u00a0<strong>incircle<\/strong> of a triangle is the largest circle that can be inscribed inside the triangle, and the radius of this circle is the inradius.<\/p>\n<p>Since an incircle is an inscribed circle, you might expect an excircle to be a circumscribed circle, but that&#8217;s not it. There are three excircles, one for each side. To find the <strong>excircle<\/strong> for a side, extend the other two sides and find the circle tangent to the side and the two extensions. The radius of an excircle is its exradius.<\/p>\n<h2>Proof<\/h2>\n<p>Baragar&#8217;s theorem follows directly from Euclid&#8217;s formula for Pythagorean triples mentioned in the previous post<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/www.johndcook.com\/osborne2.svg\" alt=\"\\begin{align*} a &amp;= m^2 - n^2 \\\\ b &amp;= 2mn \\\\ c &amp;= m^2 + n^2 \\end{align*} \" width=\"96\" height=\"79\" \/><\/p>\n<p>and formulas for the inradius <em>r<\/em> and the exradii <em>r<\/em><sub><em>a<\/em><\/sub>, <em>r<\/em><sub><em>b<\/em><\/sub>, and <em>r<\/em><sub><em>c<\/em><\/sub>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" style=\"background-color: white;\" src=\"https:\/\/www.johndcook.com\/exradii.svg\" alt=\"\\begin{align*} r &amp;= \\frac{K}{s} \\\\ r_a &amp;= \\frac{K}{s - a} \\\\ r_b &amp;= \\frac{K}{s - b} \\\\ r_c &amp;= \\frac{K}{s - c} \\\\ \\end{align*}\" width=\"80\" height=\"181\" \/><\/p>\n<p>Here\u00a0<em>K<\/em> is the area of the triangle, which in our case is\u00a0<em>ab<\/em>\/2, and\u00a0<em>s<\/em> is the semiperimeter, half the perimeter.<\/p>\n<p>Expressing the radii in terms of\u00a0<em>m<\/em> and\u00a0<em>n<\/em> gives the values cited by Wikipedia above.<\/p>\n<h2>Illustrating the theorem<\/h2>\n<p>I&#8217;d like to write a Python script to illustrate the theorem, and knowing the radii of the circles help, but we also need to know the centers of the circles.<\/p>\n<p>The center of the incircle is the weighted average of the vertices, with weights given by the lengths of the opposite sides. That is, if the vertices are\u00a0<em>A<\/em>,\u00a0<em>B<\/em>, and\u00a0<em>C<\/em>, and the sides opposite these vertices are\u00a0<em>a<\/em>,\u00a0<em>b<\/em>, and\u00a0<em>c<\/em>, the the incenter is<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" style=\"background-color: white;\" src=\"https:\/\/www.johndcook.com\/incenter_formula.svg\" alt=\"I = \\frac{aA + bB + cC}{a + b + c}\" width=\"141\" height=\"41\" \/><\/p>\n<p>The centers for the excircles have remarkably similar expressions. For the incenter of the circle opposite a vertex, flip the sign of the corresponding side.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" style=\"background-color: white;\" src=\"https:\/\/www.johndcook.com\/excenters.svg\" alt=\"\\begin{align*} I_a = \\frac{-aA + bB + cC}{-a + b + c} \\\\ I_a = \\frac{aA - bB + cC}{a - b + c} \\\\ I_a = \\frac{aA + bB - cC}{a + b - c} \\\\ \\end{align*}\" width=\"160\" height=\"137\" \/><\/p>\n<h2>Python code<\/h2>\n<p>Putting it all together, here&#8217;s an illustrate the theorem.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium\" src=\"https:\/\/www.johndcook.com\/baragar_circles.png\" width=\"480\" height=\"360\" \/><\/p>\n<p>And here&#8217;s the code that produced it. Note that everything in this section works for right triangles in general, not just Pythagorean triangles.<\/p>\n<pre>import numpy as np\r\nimport matplotlib.pyplot as plt\r\n\r\ndef connect(A, B):\r\n    plt.plot([A[0], B[0]], [A[1], B[1]], \"C0\")\r\n\r\ndef draw_circle(c, r, color):\r\n    t = np.linspace(0, 2*np.pi)\r\n    plt.plot(r*np.cos(t) + c[0], r*np.sin(t) + c[1], color=color)\r\n\r\na, b, c, = 3, 4, 5\r\n\r\nA = np.array([0, b])\r\nB = np.array([-a, 0])\r\nC = np.array([0, 0])\r\n\r\ns = (a + b + c)\/2\r\nK = a*b\/2\r\nr = K\/s\r\nra = K\/(s - a)\r\nrb = K\/(s - b)\r\nrc = K\/(s - c)\r\nI = (a*A + b*B + c*C)\/(a + b + c)\r\nIa = (-a*A + b*B + c*C)\/(-a + b + c)\r\nIb = (a*A - b*B + c*C)\/(a - b + c)\r\nIc = (a*A + b*B - c*C)\/(a + b - c)\r\n\r\ndraw_circle(I, r, \"C1\")\r\ndraw_circle(Ia, ra, \"C2\")\r\ndraw_circle(Ib, rb, \"C3\")\r\ndraw_circle(Ic, rc, \"C4\")\r\n\r\nplt.plot([-2*rc, 2*rb], [0, 0], \"C0\")\r\nplt.plot([0, 0], [-2*ra, 2*rc], \"C0\")\r\nplt.plot([(-2*ra - b)*a\/b, 2*rb], [-2*ra, 2*rb*b\/a + b], \"C0\")\r\n\r\nplt.gca().set_aspect(\"equal\")\r\nplt.show()\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This post will reveal the connection between my two previous posts: one on the Star Trek lemma and one on Pythagorean triples. In the process of writing the latter, I looked at the Wikipedia article on Pythagorean triples and noticed this curious paragraph. In every Pythagorean triangle, the radius of the\u00a0incircle\u00a0and the radii of 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":[224],"class_list":["post-247245","post","type-post","status-publish","format-standard","hentry","category-math","tag-geometry"],"acf":[],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.9 - aioseo.com -->\n\t<meta name=\"description\" content=\"Finding the incircles and excircles of Pythagorean triangles\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"John\"\/>\n\t<meta name=\"keywords\" content=\"geometry\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.johndcook.com\/blog\/2026\/06\/25\/incircle-excircle\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.9\" \/>\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=\"Incircles and Excircles of Pythagorean triangles\" \/>\n\t\t<meta property=\"og:description\" content=\"Finding the incircles and excircles of Pythagorean triangles\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.johndcook.com\/blog\/2026\/06\/25\/incircle-excircle\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2026-06-25T14:35:52+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2026-06-25T14:35:52+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Incircles and Excircles of Pythagorean triangles\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Finding the incircles and excircles of Pythagorean triangles\" \/>\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":"Incircles and Excircles of Pythagorean triangles","description":"Finding the incircles and excircles of Pythagorean triangles","canonical_url":"https:\/\/www.johndcook.com\/blog\/2026\/06\/25\/incircle-excircle\/","robots":"max-image-preview:large","keywords":"geometry","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"John D. Cook | Applied Mathematics Consulting","og:type":"article","og:title":"Incircles and Excircles of Pythagorean triangles","og:description":"Finding the incircles and excircles of Pythagorean triangles","og:url":"https:\/\/www.johndcook.com\/blog\/2026\/06\/25\/incircle-excircle\/","article:published_time":"2026-06-25T14:35:52+00:00","article:modified_time":"2026-06-25T14:35:52+00:00","twitter:card":"summary","twitter:title":"Incircles and Excircles of Pythagorean triangles","twitter:description":"Finding the incircles and excircles of Pythagorean triangles","twitter:image":"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png"},"aioseo_meta_data":{"post_id":"247245","title":null,"description":"Finding the incircles and excircles of Pythagorean triangles","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-06-25 12:07:30","updated":"2026-06-25 18:13:58","ai":{"faqs":[],"keyPoints":[],"schemas":[],"titles":[],"descriptions":[],"socialPosts":{"email":[],"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\tIncircles and Excircles of Pythagorean triangles\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":"Incircles and Excircles of Pythagorean triangles","link":"https:\/\/www.johndcook.com\/blog\/2026\/06\/25\/incircle-excircle\/"}],"_links":{"self":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247245","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=247245"}],"version-history":[{"count":3,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247245\/revisions"}],"predecessor-version":[{"id":247248,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247245\/revisions\/247248"}],"wp:attachment":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/media?parent=247245"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/categories?post=247245"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/tags?post=247245"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":247232,"date":"2026-06-25T07:00:14","date_gmt":"2026-06-25T12:00:14","guid":{"rendered":"https:\/\/www.johndcook.com\/blog\/?p=247232"},"modified":"2026-06-25T07:00:14","modified_gmt":"2026-06-25T12:00:14","slug":"consecutive-pythagorean","status":"publish","type":"post","link":"https:\/\/www.johndcook.com\/blog\/2026\/06\/25\/consecutive-pythagorean\/","title":{"rendered":"Consecutive Pythagorean triangle sides"},"content":{"rendered":"<p>In this post we find all Pythagorean triples that contain consecutive numbers, all Pythagorean triples (<em>a<\/em>,\u00a0<em>b<\/em>,\u00a0<em>c<\/em>) such that\u00a0<em>a<\/em> + 1 =\u00a0<em>b<\/em> or\u00a0<em>b<\/em> + 1 = c.<\/p>\n<h2><em>a<\/em> + 1 =\u00a0<em>b<\/em><\/h2>\n<p>George Osborne wrote a paper [1] addressing the question of when the squares of two consecutive numbers is also a square. Geometrically this is asking for primitive Pythagorean triples for which the legs are consecutive integers.<\/p>\n<p>He proved that the sequence shorter legs satisfies the recurrence relation<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" style=\"background-color: white;\" src=\"https:\/\/www.johndcook.com\/osborne0.svg\" alt=\"u_{n+2} = 6 u_{n+1} - u_{n+1} + 2\" width=\"173\" height=\"18\" \/><br \/>\nwith initial conditions <em>u<\/em><sub>0<\/sub> = 0 and <em>u<\/em><sub>1<\/sub> = 1. This is OEIS sequence <a href=\" https:\/\/oeis.org\/A001652\">A001652<\/a>.<\/p>\n<p>The method for solving recurrences like the one above is analogous to the method for solving linear differential equations. See a solution <a href=\"https:\/\/www.johndcook.com\/consecutive_pythagorean.pdf\">here<\/a>. This gives us the following formula for the terms:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" style=\"background-color: white;\" src=\"https:\/\/www.johndcook.com\/osborne.svg\" alt=\"u_n = \\dfrac{1 + \\sqrt{2}}{4} \\left(3 + 2\\sqrt{2}\\right)^n + \\dfrac{1 - \\sqrt{2}}{4} \\left(3 - 2\\sqrt{2}\\right)^n - \\dfrac{1}{2}\" width=\"367\" height=\"44\" \/><\/p>\n<h2><em>b<\/em> + 1 =\u00a0<em>c<\/em><\/h2>\n<p>It&#8217;s also possible for the longer side and hypotenuse of a Pythagorean triangle to be consecutive numbers, as in the (5, 12, 13) triangle.<\/p>\n<p>All primitive Pythagorean triples are given by Euclid&#8217;s formula<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" style=\"background-color: white;\" src=\"https:\/\/www.johndcook.com\/osborne2.svg\" alt=\"\\begin{align*} a &amp;= m^2 - n^2 \\\\ b &amp;= 2mn \\\\ c &amp;= m^2 + n^2 \\end{align*} \" width=\"96\" height=\"79\" \/><\/p>\n<p>with integers <em>m<\/em> &gt; <em>n<\/em> &gt; 0. If <em>b<\/em> and\u00a0<em>c<\/em> are consecutive numbers, then<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" style=\"background-color: white;\" src=\"https:\/\/www.johndcook.com\/osborne3.svg\" alt=\"c - b = 1 = m^2 + n^2 - 2mn = (m -n)^2\" width=\"310\" height=\"22\" \/><\/p>\n<p>and so\u00a0<em>m<\/em> =\u00a0<em>n<\/em> + 1. Therefore all possible values of\u00a0<em>b<\/em> are given by 2<em>n<\/em>(<em>n<\/em> + 1) for\u00a0<em>n<\/em> &gt; 1.<\/p>\n<p>[1] Geo. A. Osborne. A Problem in Number Theory. The American Mathematical Monthly, Vol. 21, No. 5 (May, 1914), pp. 148-150<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this post we find all Pythagorean triples that contain consecutive numbers, all Pythagorean triples (a,\u00a0b,\u00a0c) such that\u00a0a + 1 =\u00a0b or\u00a0b + 1 = c. a + 1 =\u00a0b George Osborne wrote a paper [1] addressing the question of when the squares of two consecutive numbers is also a square. Geometrically this is asking [&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-247232","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 4.9.9 - aioseo.com -->\n\t<meta name=\"description\" content=\"Finding all Pythagorean triples (a, b, c) in which a + 1 = b or b + 1 = c.\" \/>\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\/06\/25\/consecutive-pythagorean\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.9\" \/>\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=\"Consecutive Pythagorean triangle sides\" \/>\n\t\t<meta property=\"og:description\" content=\"Finding all Pythagorean triples (a, b, c) in which a + 1 = b or b + 1 = c.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.johndcook.com\/blog\/2026\/06\/25\/consecutive-pythagorean\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2026-06-25T12:00:14+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2026-06-25T12:00:14+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Consecutive Pythagorean triangle sides\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Finding all Pythagorean triples (a, b, c) in which a + 1 = b or b + 1 = c.\" \/>\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":"Consecutive Pythagorean triangle sides","description":"Finding all Pythagorean triples (a, b, c) in which a + 1 = b or b + 1 = c.","canonical_url":"https:\/\/www.johndcook.com\/blog\/2026\/06\/25\/consecutive-pythagorean\/","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":"Consecutive Pythagorean triangle sides","og:description":"Finding all Pythagorean triples (a, b, c) in which a + 1 = b or b + 1 = c.","og:url":"https:\/\/www.johndcook.com\/blog\/2026\/06\/25\/consecutive-pythagorean\/","article:published_time":"2026-06-25T12:00:14+00:00","article:modified_time":"2026-06-25T12:00:14+00:00","twitter:card":"summary","twitter:title":"Consecutive Pythagorean triangle sides","twitter:description":"Finding all Pythagorean triples (a, b, c) in which a + 1 = b or b + 1 = c.","twitter:image":"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png"},"aioseo_meta_data":{"post_id":"247232","title":null,"description":"Finding all Pythagorean triples (a, b, c) in which a + 1 = b or b + 1 = c.","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-06-25 00:58:47","updated":"2026-06-25 12:26:58","ai":{"faqs":[],"keyPoints":[],"schemas":[],"titles":[],"descriptions":[],"socialPosts":{"email":[],"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\tConsecutive Pythagorean triangle sides\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":"Consecutive Pythagorean triangle sides","link":"https:\/\/www.johndcook.com\/blog\/2026\/06\/25\/consecutive-pythagorean\/"}],"_links":{"self":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247232","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=247232"}],"version-history":[{"count":6,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247232\/revisions"}],"predecessor-version":[{"id":247244,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247232\/revisions\/247244"}],"wp:attachment":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/media?parent=247232"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/categories?post=247232"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/tags?post=247232"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}]