[{"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-27T13:13:36","modified_gmt":"2026-06-27T18:13:36","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 demoninators.<\/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> go 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-27T18:13:36+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-27T18:13:36+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-27 18:13:36","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":2,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247260\/revisions"}],"predecessor-version":[{"id":247262,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247260\/revisions\/247262"}],"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}]}},{"id":247235,"date":"2026-06-24T21:38:42","date_gmt":"2026-06-25T02:38:42","guid":{"rendered":"https:\/\/www.johndcook.com\/blog\/?p=247235"},"modified":"2026-06-25T06:31:46","modified_gmt":"2026-06-25T11:31:46","slug":"star-trek-lemma","status":"publish","type":"post","link":"https:\/\/www.johndcook.com\/blog\/2026\/06\/24\/star-trek-lemma\/","title":{"rendered":"The Star Trek lemma"},"content":{"rendered":"<p>I was reading an article this evening and saw a footnote to a book by Arthur Baragar [1]. This caught my eye because he was my officemate at UT for a year.<\/p>\n<p>I found his book on <a href=\"https:\/\/archive.org\/details\/surveyofclassica0000bara\">Archive.org<\/a> and was surprised to see &#8220;The Star Trek Lemma&#8221; in the table of contents. What could this be?<\/p>\n<p>It&#8217;s a theorem that goes back to Euclid that applies to an angle formed by connecting a point to two other points on a circle. The theorem says &#8220;The measure of an inscribed angle is half the measure of the arc it subtends.&#8221; But why call it the Star Trek lemma? Quoting Arthur:<\/p>\n<p>In the spirit of Euclid, we will refer to this theorem as the Star Trek lemma because of the figure associated with the statement of the theorem. \u2026 Before Star Trek, as far as I know, this theorem had no name, though some might call it Euclid III.20, which is its proposition number in Euclid&#8217;s\u00a0<em>Elements<\/em> (Book III, Proposition 20).<\/p>\n<p>Here is my reconstruction of the figure given in the book.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium\" src=\"https:\/\/www.johndcook.com\/baragar_star_trek.png\" alt=\"Baragar's illustration of the Star Trek lemma\" width=\"300\" height=\"332\" \/><\/p>\n<p>The lemma says that \u2220BAC is half of \u2220BOC.<\/p>\n<p>[1] Baragar, Arthur (2001), <i>A Survey of Classical and Modern Geometries: With Computer Activities<\/i>, Prentice Hall<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was reading an article this evening and saw a footnote to a book by Arthur Baragar [1]. This caught my eye because he was my officemate at UT for a year. I found his book on Archive.org and was surprised to see &#8220;The Star Trek Lemma&#8221; in the table of contents. What could this [&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-247235","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=\"The Star Trek lemma is Arthur Baragar&#039;s name for Euclid book III Proposition 20.\" \/>\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\/24\/star-trek-lemma\/\" \/>\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=\"The Star Trek lemma\" \/>\n\t\t<meta property=\"og:description\" content=\"The Star Trek lemma is Arthur Baragar&#039;s name for Euclid book III Proposition 20.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.johndcook.com\/blog\/2026\/06\/24\/star-trek-lemma\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2026-06-25T02:38:42+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2026-06-25T11:31:46+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"The Star Trek lemma\" \/>\n\t\t<meta name=\"twitter:description\" content=\"The Star Trek lemma is Arthur Baragar&#039;s name for Euclid book III Proposition 20.\" \/>\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":"The Star Trek lemma","description":"The Star Trek lemma is Arthur Baragar's name for Euclid book III Proposition 20.","canonical_url":"https:\/\/www.johndcook.com\/blog\/2026\/06\/24\/star-trek-lemma\/","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":"The Star Trek lemma","og:description":"The Star Trek lemma is Arthur Baragar's name for Euclid book III Proposition 20.","og:url":"https:\/\/www.johndcook.com\/blog\/2026\/06\/24\/star-trek-lemma\/","article:published_time":"2026-06-25T02:38:42+00:00","article:modified_time":"2026-06-25T11:31:46+00:00","twitter:card":"summary","twitter:title":"The Star Trek lemma","twitter:description":"The Star Trek lemma is Arthur Baragar's name for Euclid book III Proposition 20.","twitter:image":"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png"},"aioseo_meta_data":{"post_id":"247235","title":null,"description":"The Star Trek lemma is Arthur Baragar's name for Euclid book III Proposition 20.","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 02:04:36","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\tThe Star Trek lemma\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":"The Star Trek lemma","link":"https:\/\/www.johndcook.com\/blog\/2026\/06\/24\/star-trek-lemma\/"}],"_links":{"self":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247235","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=247235"}],"version-history":[{"count":4,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247235\/revisions"}],"predecessor-version":[{"id":247242,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247235\/revisions\/247242"}],"wp:attachment":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/media?parent=247235"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/categories?post=247235"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/tags?post=247235"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":247223,"date":"2026-06-23T19:26:11","date_gmt":"2026-06-24T00:26:11","guid":{"rendered":"https:\/\/www.johndcook.com\/blog\/?p=247223"},"modified":"2026-06-24T05:54:58","modified_gmt":"2026-06-24T10:54:58","slug":"regex-everywhere","status":"publish","type":"post","link":"https:\/\/www.johndcook.com\/blog\/2026\/06\/23\/regex-everywhere\/","title":{"rendered":"Regular expressions that work &#8220;everywhere&#8221;"},"content":{"rendered":"<p>The most frustrating aspect of regular expressions is that implementations vary. Features supported in one tool may not be supported at all in another tool, or they may be supported with slightly different syntax.<\/p>\n<p>I learned regular expressions in the context Perl, a maximalist regex environment. This led to frustration when features I expect to work are missing [1]. One way around this is to use <a href=\"https:\/\/www.johndcook.com\/blog\/2013\/08\/20\/perl-as-a-better\/\">Perl analogs<\/a> of other tools, but this is very non-standard. I want to be able to send colleagues and clients code that works out of the box.<\/p>\n<p>As I mentioned in my post on <a href=\"https:\/\/www.johndcook.com\/blog\/2019\/10\/09\/computational-survivalist\/\">computational survivalism<\/a>, I occasionally need to work on computers that I cannot install software on. So a better approach is to identify a subset of regex features that work everywhere. The stricter your definition of &#8220;everywhere&#8221; the less this includes. The strictest subset would be<\/p>\n<ul>\n<li>literals<\/li>\n<li>character classes <code>[\u2026]<\/code><\/li>\n<li>the special characters <code>. * ^ $<\/code><\/li>\n<\/ul>\n<p>A more relaxed definition of &#8220;everywhere&#8221; would be the tools you most care about. Currently the tools I most want to use with regular expressions are sed, awk, grep, and Emacs.<\/p>\n<h2>Awk as lowest common denominator<\/h2>\n<p>If you use the Gnu versions of sed, awk, and grep, and use the <code>-E<\/code> option with sed and grep, then the list of common features is bigger. The regular expression features of of the three tools are similar, and awk&#8217;s features are supported in the other tools, with one exception: word boundaries in awk are <code>\\&lt;<\/code> and <code>\\&gt;<\/code> rather than <code>\\b<\/code> and <code>\\B<\/code>.<\/p>\n<p>I wrote about Awk&#8217;s regex features <a href=\"https:\/\/www.johndcook.com\/blog\/awk-regular-expressions\/\">here<\/a>.<\/p>\n<h2>Emacs as the oddball<\/h2>\n<p>Emacs supports analogs of most of awk&#8217;s regex features. However, the characters<\/p>\n<pre>    + ? ( ) { } |<\/pre>\n<p>all require a backslash in front in order to act like the awk counterparts. Also, the analog of <code>\\s<\/code> and <code>\\S<\/code> in awk is <code>\\s-<\/code> and <code>\\S-<\/code> in Emacs.<\/p>\n<p>Instead of meaning space or nonspace, <code>\\s<\/code> and <code>\\S<\/code> in Emacs begin a (negated) character class, and one of those classes is <code>-<\/code> for space. But there are many others. For example, <code>\\s.<\/code> stands for a punctuation character and <code>\\S.<\/code> stands for a non-punctuation character.<\/p>\n<h2>What works everywhere<\/h2>\n<p>So for my definition of &#8220;everywhere,&#8221; with the caveats mentioned above, the following features work everywhere. YMMV.<\/p>\n<pre>    .\r\n    ^, $\r\n    [\u2026], [^\u2026]\r\n    *\r\n    \\w, \\W, \\s, \\S\r\n    \\1 - \\9 backreferences\r\n    \\b \\B\r\n    ? + \r\n    | alternation\r\n    {n,m} for counting matches\r\n    (...) capturing\r\n<\/pre>\n<p>One footnote is that gawk supports backreferences in replacement strings but not in regular expressions <em>per se<\/em>.<\/p>\n<p>[1] To some extent, basic Perl features work elsewhere and advanced features do not, depending on your idea of what is basic or advanced. I think of <a href=\"https:\/\/www.johndcook.com\/blog\/2014\/05\/01\/look-behind-regex\/\">look-around<\/a> features as advanced, and that tracks. But I think of <code>\\d<\/code> for digits as basic, but that&#8217;s not supported in many regex flavors.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The most frustrating aspect of regular expressions is that implementations vary. Features supported in one tool may not be supported at all in another tool, or they may be supported with slightly different syntax. I learned regular expressions in the context Perl, a maximalist regex environment. This led to frustration when features I expect to [&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":[116],"class_list":["post-247223","post","type-post","status-publish","format-standard","hentry","category-computing","tag-regular-expressions"],"acf":[],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.9 - aioseo.com -->\n\t<meta name=\"description\" content=\"What regular expression features work everywhere. Very few unless you relax your definition of &quot;everywhere.&quot;\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"John\"\/>\n\t<meta name=\"keywords\" content=\"regular expressions\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.johndcook.com\/blog\/2026\/06\/23\/regex-everywhere\/\" \/>\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=\"Regular expressions that work \u201ceverywhere\u201d\" \/>\n\t\t<meta property=\"og:description\" content=\"What regular expression features work everywhere. Very few unless you relax your definition of &quot;everywhere.&quot;\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.johndcook.com\/blog\/2026\/06\/23\/regex-everywhere\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2026-06-24T00:26:11+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2026-06-24T10:54:58+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Regular expressions that work \u201ceverywhere\u201d\" \/>\n\t\t<meta name=\"twitter:description\" content=\"What regular expression features work everywhere. Very few unless you relax your definition of &quot;everywhere.&quot;\" \/>\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":"Regular expressions that work \u201ceverywhere\u201d","description":"What regular expression features work everywhere. Very few unless you relax your definition of \"everywhere.\"","canonical_url":"https:\/\/www.johndcook.com\/blog\/2026\/06\/23\/regex-everywhere\/","robots":"max-image-preview:large","keywords":"regular expressions","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"John D. Cook | Applied Mathematics Consulting","og:type":"article","og:title":"Regular expressions that work \u201ceverywhere\u201d","og:description":"What regular expression features work everywhere. Very few unless you relax your definition of &quot;everywhere.&quot;","og:url":"https:\/\/www.johndcook.com\/blog\/2026\/06\/23\/regex-everywhere\/","article:published_time":"2026-06-24T00:26:11+00:00","article:modified_time":"2026-06-24T10:54:58+00:00","twitter:card":"summary","twitter:title":"Regular expressions that work \u201ceverywhere\u201d","twitter:description":"What regular expression features work everywhere. Very few unless you relax your definition of &quot;everywhere.&quot;","twitter:image":"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png"},"aioseo_meta_data":{"post_id":"247223","title":null,"description":"What regular expression features work everywhere. Very few unless you relax your definition of \"everywhere.\"","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-23 23:18:02","updated":"2026-06-24 10:54: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\/computing\/\" title=\"Computing\">Computing<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tRegular expressions that work \u201ceverywhere\u201d\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":"Regular expressions that work &#8220;everywhere&#8221;","link":"https:\/\/www.johndcook.com\/blog\/2026\/06\/23\/regex-everywhere\/"}],"_links":{"self":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247223","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=247223"}],"version-history":[{"count":8,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247223\/revisions"}],"predecessor-version":[{"id":247231,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247223\/revisions\/247231"}],"wp:attachment":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/media?parent=247223"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/categories?post=247223"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/tags?post=247223"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":247217,"date":"2026-06-22T15:02:47","date_gmt":"2026-06-22T20:02:47","guid":{"rendered":"https:\/\/www.johndcook.com\/blog\/?p=247217"},"modified":"2026-06-22T15:08:20","modified_gmt":"2026-06-22T20:08:20","slug":"lobachevskys-integral-formula","status":"publish","type":"post","link":"https:\/\/www.johndcook.com\/blog\/2026\/06\/22\/lobachevskys-integral-formula\/","title":{"rendered":"Lobachevsky&#8217;s integral formula"},"content":{"rendered":"<p>Let <em>f<\/em> be an even function with period \u03c0. Then the following remarkable theorem by Lobachevsky holds.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" style=\"background-color: white;\" src=\"https:\/\/www.johndcook.com\/lobachevsky.svg\" alt=\"\\int_0^\\infty \\frac{\\sin^2 x}{x^2} f(x) \\, dx = \\int_0^\\infty\\frac{\\sin x} x f(x) \\, dx = \\int_0^{\\pi\/2} f(x) \\, dx\" width=\"455\" height=\"49\" \/><\/p>\n<p>This theorem is useful in Fourier analysis and signal processing. It&#8217;s useful to know even in the special case <em>f<\/em>(<em>x<\/em>) = 1.<\/p>\n<p>For a &#8220;jinc&#8221; analog, see <a href=\"https:\/\/arxiv.org\/abs\/2006.09575v1\">this paper<\/a>.<\/p>\n<p style=\"text-align: center;\">***<\/p>\n<p>Every time I see the name Lobachevsky I think of Tom Lehrer&#8217;s song about him. You can find the words <a href=\"https:\/\/tomlehrersongs.com\/wp-content\/uploads\/2018\/12\/lobachevsky.pdf\">here<\/a> and the audio <a href=\"https:\/\/www.youtube.com\/watch?v=rlgRDdWUs7g\">here<\/a>.<\/p>\n<h2>Related posts<\/h2>\n<ul>\n<li class=\"link\"><a href=\"https:\/\/www.johndcook.com\/blog\/2015\/12\/16\/sinc-and-jinc-integrals\/\">Sinc and jinc integrals<\/a><\/li>\n<li class=\"link\"><a href=\"https:\/\/www.johndcook.com\/blog\/2015\/12\/17\/sinc-and-jinc-sums\/\">Sinc and jinc sums<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Let f be an even function with period \u03c0. Then the following remarkable theorem by Lobachevsky holds. This theorem is useful in Fourier analysis and signal processing. It&#8217;s useful to know even in the special case f(x) = 1. For a &#8220;jinc&#8221; analog, see this paper. *** Every time I see the name Lobachevsky I [&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":[178],"class_list":["post-247217","post","type-post","status-publish","format-standard","hentry","category-math","tag-fourier-analysis"],"acf":[],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.9 - aioseo.com -->\n\t<meta name=\"description\" content=\"Integrating sinc or sinc^2 times a periodic function using Lobachevsky&#039;s integral formula\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"John\"\/>\n\t<meta name=\"keywords\" content=\"fourier analysis\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.johndcook.com\/blog\/2026\/06\/22\/lobachevskys-integral-formula\/\" \/>\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=\"Lobachevsky\u2019s integral formula\" \/>\n\t\t<meta property=\"og:description\" content=\"Integrating sinc or sinc^2 times a periodic function using Lobachevsky&#039;s integral formula\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.johndcook.com\/blog\/2026\/06\/22\/lobachevskys-integral-formula\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2026-06-22T20:02:47+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2026-06-22T20:08:20+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Lobachevsky\u2019s integral formula\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Integrating sinc or sinc^2 times a periodic function using Lobachevsky&#039;s integral formula\" \/>\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":"Lobachevsky\u2019s integral formula","description":"Integrating sinc or sinc^2 times a periodic function using Lobachevsky's integral formula","canonical_url":"https:\/\/www.johndcook.com\/blog\/2026\/06\/22\/lobachevskys-integral-formula\/","robots":"max-image-preview:large","keywords":"fourier analysis","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"John D. Cook | Applied Mathematics Consulting","og:type":"article","og:title":"Lobachevsky\u2019s integral formula","og:description":"Integrating sinc or sinc^2 times a periodic function using Lobachevsky's integral formula","og:url":"https:\/\/www.johndcook.com\/blog\/2026\/06\/22\/lobachevskys-integral-formula\/","article:published_time":"2026-06-22T20:02:47+00:00","article:modified_time":"2026-06-22T20:08:20+00:00","twitter:card":"summary","twitter:title":"Lobachevsky\u2019s integral formula","twitter:description":"Integrating sinc or sinc^2 times a periodic function using Lobachevsky's integral formula","twitter:image":"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png"},"aioseo_meta_data":{"post_id":"247217","title":null,"description":"Integrating sinc or sinc^2 times a periodic function using Lobachevsky's integral formula","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-22 19:42:00","updated":"2026-06-23 12:06:02","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\tLobachevsky\u2019s integral formula\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":"Lobachevsky&#8217;s integral formula","link":"https:\/\/www.johndcook.com\/blog\/2026\/06\/22\/lobachevskys-integral-formula\/"}],"_links":{"self":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247217","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=247217"}],"version-history":[{"count":3,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247217\/revisions"}],"predecessor-version":[{"id":247220,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247217\/revisions\/247220"}],"wp:attachment":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/media?parent=247217"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/categories?post=247217"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/tags?post=247217"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":247212,"date":"2026-06-21T19:21:44","date_gmt":"2026-06-22T00:21:44","guid":{"rendered":"https:\/\/www.johndcook.com\/blog\/?p=247212"},"modified":"2026-06-22T06:36:22","modified_gmt":"2026-06-22T11:36:22","slug":"queens-prime","status":"publish","type":"post","link":"https:\/\/www.johndcook.com\/blog\/2026\/06\/21\/queens-prime\/","title":{"rendered":"Queens on a prime order board"},"content":{"rendered":"<p>The\u00a0<em>n<\/em> queens problem is to place on an\u00a0<em>n<\/em> \u00d7\u00a0<em>n<\/em> chessboard\u00a0<em>n<\/em> queens so that none attacks any other. This means there is only one queen on every horizontal, vertical, and diagonal line.<\/p>\n<p>When\u00a0<em>n<\/em> is a <strong>prime number<\/strong> \u2265 5, it is sufficient to place the queens on a line that has slope 2, 3, 4, \u2026, <em>n<\/em> \u2212 2. (The slope cannot be 1 because that&#8217;s a diagonal. And it cannot be <em>n<\/em> \u2212 1 because <i>n <\/i>\u2212 1 = \u22121 mod\u00a0<em>n<\/em> is also a diagonal.) [1]<\/p>\n<p>Here we imagine opposite edges of the board being joined together. Geometrically, this makes the chessboard a torus (donut). Algebraically, the points on a line of slope <em>s<\/em> have the coordinates<\/p>\n<p style=\"padding-left: 40px;\">(<em>a<\/em> +\u00a0<em>k<\/em>,\u00a0<em>b<\/em> +\u00a0<em>ks<\/em>)<\/p>\n<p>where addition is carried out mod\u00a0<em>n<\/em>.<\/p>\n<p><strong>All<\/strong> solutions to the\u00a0<em>n<\/em> queens problem have this form when\u00a0<em>n<\/em> = 5. <strong>Some<\/strong> solutions will have this form for larger prime values of <em>n<\/em> but not all.<\/p>\n<p>For example, when\u00a0<em>n<\/em> = 7, here is a solution where all the queens are on a line of slope 2.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium\" src=\"https:\/\/www.johndcook.com\/queens71.png\" width=\"400\" height=\"400\" \/><\/p>\n<p>But here is another solution where the queens do not all lie on a line of constant slope.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium\" src=\"https:\/\/www.johndcook.com\/queens72.png\" width=\"400\" height=\"400\" \/><\/p>\n<h2>Related posts<\/h2>\n<ul>\n<li class=\"link\"><a href=\"https:\/\/www.johndcook.com\/blog\/2025\/05\/11\/one-hot-sat\/\">Formulating eight queens as a SAT problem<\/a><\/li>\n<li class=\"link\"><a href=\"https:\/\/www.johndcook.com\/blog\/2021\/08\/18\/queens-on-a-donut\/\">Queens on a donut<\/a><\/li>\n<li class=\"link\"><a href=\"https:\/\/www.johndcook.com\/blog\/2026\/06\/11\/prolog-claude\/\">Solving a chess puzzle with Claude and Prolog<\/a><\/li>\n<\/ul>\n<p>[1] W. H. Bussey. A Note on the Problem of the Eight Queens. The American Mathematical Monthly, Vol. 29, No. 7 (August 1922), pp. 252\u2013253<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The\u00a0n queens problem is to place on an\u00a0n \u00d7\u00a0n chessboard\u00a0n queens so that none attacks any other. This means there is only one queen on every horizontal, vertical, and diagonal line. When\u00a0n is a prime number \u2265 5, it is sufficient to place the queens on a line that has slope 2, 3, 4, \u2026, [&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,197],"class_list":["post-247212","post","type-post","status-publish","format-standard","hentry","category-math","tag-chess","tag-combinatorics"],"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 place p queens on a p by p chessboard when p is a prime number.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"John\"\/>\n\t<meta name=\"keywords\" content=\"chess,combinatorics\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.johndcook.com\/blog\/2026\/06\/21\/queens-prime\/\" \/>\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=\"Queens on a prime order board\" \/>\n\t\t<meta property=\"og:description\" content=\"How to place p queens on a p by p chessboard when p is a prime number.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.johndcook.com\/blog\/2026\/06\/21\/queens-prime\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2026-06-22T00:21:44+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2026-06-22T11:36:22+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Queens on a prime order board\" \/>\n\t\t<meta name=\"twitter:description\" content=\"How to place p queens on a p by p chessboard when p is a prime 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":"Queens on a prime order board","description":"How to place p queens on a p by p chessboard when p is a prime number.","canonical_url":"https:\/\/www.johndcook.com\/blog\/2026\/06\/21\/queens-prime\/","robots":"max-image-preview:large","keywords":"chess,combinatorics","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"John D. Cook | Applied Mathematics Consulting","og:type":"article","og:title":"Queens on a prime order board","og:description":"How to place p queens on a p by p chessboard when p is a prime number.","og:url":"https:\/\/www.johndcook.com\/blog\/2026\/06\/21\/queens-prime\/","article:published_time":"2026-06-22T00:21:44+00:00","article:modified_time":"2026-06-22T11:36:22+00:00","twitter:card":"summary","twitter:title":"Queens on a prime order board","twitter:description":"How to place p queens on a p by p chessboard when p is a prime number.","twitter:image":"https:\/\/www.johndcook.com\/blog\/wp-content\/uploads\/2022\/05\/twittercard.png"},"aioseo_meta_data":{"post_id":"247212","title":null,"description":"How to place p queens on a p by p chessboard when p is a prime 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-21 23:22:41","updated":"2026-06-22 11:36:57","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\tQueens on a prime order board\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":"Queens on a prime order board","link":"https:\/\/www.johndcook.com\/blog\/2026\/06\/21\/queens-prime\/"}],"_links":{"self":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247212","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=247212"}],"version-history":[{"count":4,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247212\/revisions"}],"predecessor-version":[{"id":247216,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/posts\/247212\/revisions\/247216"}],"wp:attachment":[{"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/media?parent=247212"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/categories?post=247212"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.johndcook.com\/blog\/wp-json\/wp\/v2\/tags?post=247212"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}]