<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>And now it’s all this</title>
	<atom:link href="https://leancrew.com/all-this/feed/" rel="self" type="application/rss+xml" />
	<link>https://leancrew.com/all-this/</link>
	<description>I just said what I said and it was wrong. Or was taken wrong.</description>
	<lastBuildDate>Mon, 06 Apr 2026 00:42:45 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.0</generator>
  <atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/>
  <atom:link rel="hub" href="http://aniat.superfeedr.com"/>

<item>
<title>Easter in Mathematica</title>
<link>https://leancrew.com/all-this/2026/04/easter-in-mathematica/</link>
<pubDate>Mon, 06 Apr 2026 00:42:45 +0000</pubDate>
<dc:creator>
  <![CDATA[Dr. Drang]]>
</dc:creator>
<guid>https://leancrew.com/all-this/2026/04/easter-in-mathematica/</guid>
<description>
  <![CDATA[<a href="https://leancrew.com/all-this/2026/04/scientific-americans-easter/">Yesterday’s post</a> included some behind-the-scenes calculations that I figured were worth talking about. They were all done in Mathematica, and here’s the notebook I used:]]>
</description>
<content:encoded>
  <![CDATA[<p><a href="https://leancrew.com/all-this/2026/04/scientific-americans-easter/">Yesterday’s post</a> included some behind-the-scenes calculations that I figured were worth talking about. They were all done in Mathematica, and here’s the notebook I used:</p>
<iframe height="600" src="https://www.wolframcloud.com/obj/mark80/Published/easter-dates.nb?_embed=iframe" width="100%"></iframe>
<p>The first calculation works out the days of the vernal equinox in every year from 1961 through 2026. The key function for this is <a href="http://reference.wolfram.com/language/ref/FindAstroEvent.html"><code>FindAstroEvent</code></a>, a fairly new function that returns the date and time of the first occurrence of a given event after the given date. I asked for the first <code>MarchEquinox</code> after January 1 of each year, and I wanted the time to be given in Greenwich Mean Time. Since I only cared about the day of the month, I used the <a href="http://reference.wolfram.com/language/ref/DateList.html"><code>DateList</code> function</a> to convert the <code>DateObject</code> returned by <code>FindAstroEvent</code> into a list of year, month, day, hour, minute, and second and pulled out just the third item of that list.</p>
<p>With <code>equinoxes</code> set to a list of 19s, 20s, and 21s, I used the <a href="http://reference.wolfram.com/language/ref/Tally.html"><code>Tally</code> function</a> to count the occurrences of each day number. As you can see, there were 58 20s in the list of 66 equinoxes, so I included that result in the post to show that March 20 is the most common date of the vernal equinox.</p>
<p>The remaining calculations were done to compare the algorithmic date of Easter with the date that Easter would be if it were determined by the actual date of the first full moon after the vernal equinox. So I used <code>FindAstroEvent</code> again, this time setting the event to <code>FullMoon</code> and the date to the equinox dates calculated earlier. That list of <code>DateObject</code>s was saved to the variable <code>fullMoons</code>.</p>
<p>I needed to compare these dates to the dates of Easter for the years of interest. Oddly, Mathematica doesn’t seem to have a built-in function for calculating Easter, but it does have a <a href="http://reference.wolfram.com/language/ref/ResourceFunction.html"><code>ResourceFunction</code></a>. The function is called <a href="https://resources.wolframcloud.com/FunctionRepository/resources/EasterSunday"><code>EasterSunday</code></a>, and it calculates the date for the given year.</p>
<p>With the lists of <code>easters</code> and <code>fullMoons</code> in hand, I subtracted the latter from the former. If the difference is more than a week, the algorithmic and astronomical Easters aren’t in agreement. As you can see, there are two instances in which Easter is 31 days after the full moon: first in 1962 (which I didn’t mention in the post) and then again in 2019 (which I did). The final calculation was just a repeat of one of the calculations in <code>equinoxes</code>; I did it again so I wouldn’t have to hunt down the 2019 equinox date.</p>
<p>I’m not sure when I learned of the <code>FindAstroEvent</code> function, but it really came in handy yesterday. I’m pretty sure there are functions in <a href="https://lccn.loc.gov/2017024295"><em>Calendrical Calculations</em></a> that deal with equinoxes and full moons, but I haven’t gotten that far in the book yet.</p>]]>
</content:encoded>
</item>

<item>
<title>Scientific American’s Easter</title>
<link>https://leancrew.com/all-this/2026/04/scientific-americans-easter/</link>
<pubDate>Sun, 05 Apr 2026 04:12:31 +0000</pubDate>
<dc:creator>
  <![CDATA[Dr. Drang]]>
</dc:creator>
<guid>https://leancrew.com/all-this/2026/04/scientific-americans-easter/</guid>
<description>
  <![CDATA[In its continuing attempt to teach us how calendars work, <em>Scientific American</em> has <a href="https://www.scientificamerican.com/article/the-mathematical-formula-that-reveals-when-easter-is-every-year/">an article</a> (<a href="https://apple.news/A8aMtxwNRRFa9rJIYdWMbMA">Apple News link</a>) up today that goes through <a href="https://en.wikipedia.org/wiki/Date_of_Easter#Gauss's_Easter_algorithm">Gauss’s algorithm</a> for calculating the date of Easter. The article was written by Manon Bischoff, who also wrote <a href="https://www.scientificamerican.com/article/why-friday-the-13th-is-a-mathematical-inevitability/">the Friday the 13th article</a> I covered <a href="https://leancrew.com/all-this/2026/03/scientific-american-and-friday-the-13th/">a few weeks ago</a>.]]>
</description>
<content:encoded>
  <![CDATA[<p>[Equations in this post may not look right (or appear at all) in your RSS reader. Go to <a href="https://leancrew.com/all-this/2026/04/scientific-americans-easter/">the original article</a> to see them rendered properly.]</p>
  <hr />
  <p>In its continuing attempt to teach us how calendars work, <em>Scientific American</em> has <a href="https://www.scientificamerican.com/article/the-mathematical-formula-that-reveals-when-easter-is-every-year/">an article</a> (<a href="https://apple.news/A8aMtxwNRRFa9rJIYdWMbMA">Apple News link</a>) up today that goes through <a href="https://en.wikipedia.org/wiki/Date_of_Easter#Gauss's_Easter_algorithm">Gauss’s algorithm</a> for calculating the date of Easter. The article was written by Manon Bischoff, who also wrote <a href="https://www.scientificamerican.com/article/why-friday-the-13th-is-a-mathematical-inevitability/">the Friday the 13th article</a> I covered <a href="https://leancrew.com/all-this/2026/03/scientific-american-and-friday-the-13th/">a few weeks ago</a>.</p>
<p>There are a few small mistakes in the article: one computational and two definitional. Let’s take a look at them.</p>
<p>The computational error comes in the calculation of the intermediate value <em>p</em>. The article says</p>
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mi>p</mi><mo>=</mo><mrow><mo form="prefix" stretchy="true">⌊</mo><mfrac><mi>k</mi><mn>3</mn></mfrac><mo form="postfix" stretchy="true">⌋</mo></mrow></mrow></math>
<p>where the topless brackets mean the <a href="https://mathworld.wolfram.com/FloorFunction.html">floor function</a>, the integer less than or equal to what’s inside the brackets. The correct equation is</p>
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mi>p</mi><mo>=</mo><mrow><mo form="prefix" stretchy="true">⌊</mo><mfrac><mrow><mn>13</mn><mo>+</mo><mn>8</mn><mi>k</mi></mrow><mn>25</mn></mfrac><mo form="postfix" stretchy="true">⌋</mo></mrow></mrow></math>
<p>In both equations, <em>k</em> is</p>
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mi>k</mi><mo>=</mo><mrow><mo form="prefix" stretchy="true">⌊</mo><mfrac><mi>y</mi><mn>100</mn></mfrac><mo form="postfix" stretchy="true">⌋</mo></mrow></mrow></math>
<p>i.e., the first two digits of the year (at least until we get to the year 10,000).</p>
<p>In giving the wrong equation for <em>p</em>, Bischoff is following Gauss himself. In the original presentation of his Easter algorithm, Gauss gave the same simple formula as Bischoff, but he corrected it several years later. Why Bischoff is still using the wrong equation two centuries later is anyone’s guess.</p>
<p>Actually, I <em>can</em> guess. Maybe Bischoff’s using the wrong formula for <em>p</em> because it’s simpler and the error won’t manifest itself until the year 4200 (!). Here’s a quick Python script to see the centuries, starting in the 1600s, for which the simpler formula is wrong:</p>
<pre><code>python:
for k in range(16, 60):
  if k//3 != (13 + 8*k)//25:
    print(f'Century {k*100} gives the wrong value')
</code></pre>
<p>The output is</p>
<pre><code>Century 4200 gives the wrong value
Century 4500 gives the wrong value
Century 4800 gives the wrong value
Century 5100 gives the wrong value
Century 5400 gives the wrong value
Century 5700 gives the wrong value
</code></pre>
<p>I think we can live with a mistake that won’t rear its head for over 2000 years.</p>
<p>I’m less inclined to overlook the definitional errors in the article’s early paragraphs. This one:</p>
<blockquote>
<p>For those who celebrate it, tracking what day the holiday Easter takes place on can be a challenge. According to Christian religious traditions, Easter Sunday falls on the first Sunday following the first full moon after the vernal equinox.</p>
</blockquote>
<p>And this one:</p>
<blockquote>
<p>[T]he vernal equinox, or start of spring, is fixed as March 21. If a full moon occurs on that exact day, March 22 becomes the earliest possible calendar date for Easter Sunday. According to the lunar calendar, the latest possible date for a full moon after March 21 is April 18. That means Easter Sunday never falls later than April 25.</p>
</blockquote>
<p>While it’s true that the idea behind the date of Easter is to be “on the first Sunday following the first full moon after the vernal equinox,” when it comes to determining Easter, both the equinox and the lunar cycle are estimated—they aren’t based on accurate astronomical calculations or observations.</p>
<p>First, let’s look at the vernal equinox.<sup id="fnref:spring"><a href="#fn:spring" rel="footnote">1</a></sup> One need only think back a couple of weeks to realize that it isn’t “fixed as March 21.” The most recent equinox was on March 20, as were 58 of the 66 vernal equinoxes I’ve lived through. March 20 is by far the most common date for the true vernal equinox. The Church fathers who set the date of Easter used March 21 as an approximation because it made the calculation simple and resulted in Easters more or less when they thought they should be.</p>
<p>Similarly, they used the <a href="https://en.wikipedia.org/wiki/Metonic_cycle">Metonic cycle</a>—with some occasional adjustments—to estimate when full moons would occur. There are almost exactly 235 lunar months in 19 years, a fact you can use to calculate a good estimate of when full moons occur.<sup id="fnref:19"><a href="#fn:19" rel="footnote">2</a></sup> But this is an average, and because lunar months vary in length, the date of a calculated full moon doesn’t always fall on the date of an actual full moon. (There’s also a slow drift that has to be accounted for.)</p>
<p>So although the date of Easter is <em>guided</em> by astronomical events, it isn’t <em>determined</em> by them. As it happens, this year the vernal equinox was, as we said, on Friday, March 20, and the following full moon was on Wednesday, April 1. So having Easter Sunday on April 5 works out both astronomically and algorithmically. But in 2019, that wasn’t the case. The vernal equinox was on Wednesday, March 20; the following full moon was on Thursday, March 21; but Easter Sunday was celebrated on April 21, not March 24.</p>
<div class="footnotes">
<hr/>
<ol>
<li id="fn:spring">
<p>My apologies to those of you in the Southern Hemisphere. I’m talking about the equinox in March, which was vernal to the people who decided when Easter should be celebrated. <a href="#fnref:spring" rev="footnote">↩</a></p>
</li>
<li id="fn:19">
<p>If you go through the calculations Bischoff presents, you’ll see a division by 19. That’s the Metonic cycle in action. <a href="#fnref:19" rev="footnote">↩</a></p>
</li>
</ol>
</div>
  ]]>
</content:encoded>
</item>

<item>
<title>A less complicated complication</title>
<link>https://leancrew.com/all-this/2026/03/a-less-complicated-complication/</link>
<pubDate>Sun, 29 Mar 2026 15:42:04 +0000</pubDate>
<dc:creator>
  <![CDATA[Dr. Drang]]>
</dc:creator>
<guid>https://leancrew.com/all-this/2026/03/a-less-complicated-complication/</guid>
<description>
  <![CDATA[Back in January, <a href="https://leancrew.com/all-this/2026/01/a-complication-thats-one-step-too-complicated/">I complained</a> about the Apple Watch’s Timer complication being too complicated. A couple of days ago, Dan Moren told me <a href="https://zeppelin.flights/@dmoren/116303829086040884">on Mastodon</a> that my complaint had been addressed in <a href="https://support.apple.com/en-us/123002">watchOS 26.4</a>, which was released earlier this week. After a surprisingly quick update of my watch (I had already updated every other device to 26.4 but somehow forgot to do the watch), I added a 3-minute timer as the bottom center complication and, miracle of miracles, it worked exactly as it should.]]>
</description>
<content:encoded>
  <![CDATA[<p>Back in January, <a href="https://leancrew.com/all-this/2026/01/a-complication-thats-one-step-too-complicated/">I complained</a> about the Apple Watch’s Timer complication being too complicated. A couple of days ago, Dan Moren told me <a href="https://zeppelin.flights/@dmoren/116303829086040884">on Mastodon</a> that my complaint had been addressed in <a href="https://support.apple.com/en-us/123002">watchOS 26.4</a>, which was released earlier this week. After a surprisingly quick update of my watch (I had already updated every other device to 26.4 but somehow forgot to do the watch), I added a 3-minute timer as the bottom center complication and, miracle of miracles, it worked exactly as it should.</p>
<p><img alt="Apple Watch with 3-minute timer complication" class="ss" src="https://leancrew.com/all-this/images2026/20260329-Apple%20Watch%20with%203-minute%20timer%20complication.png" title="Apple Watch with 3-minute timer complication" width="40%"/></p>
<p>To recap, my January complaint was that although I could create a complication that looked like it would start a 30-second timer when tapped, that complication actually required a second tap on a smaller button to start it—a stupid way to implement the feature. As of 26.4, the stupidity has been removed. Now the timer starts immediately when you tap the complication.</p>
<p>If you’d like a quick way to set a specific timer on your watch, press and hold on your watch’s home screen, tap the Edit button, and then swipe (if necessary) to get to the complications screen. Tap the complication you want to change to a Timer, scroll through the list, and choose Timers. At this point, you will be given the option to choose either a generic timer complication—one that just opens the Timers app—or one set to one of the specific times you’ve created in the Timers app.</p>
<p><img alt="Apple Watch complication setting" class="ss" src="https://leancrew.com/all-this/images2026/20260329-Apple%20Watch%20complication%20setting.png" title="Apple Watch complication setting" width="40%"/></p>
<p>Choose the one you want and go back to your home screen. Now you have a specific timer complication that works the way it should.</p>
<p>(Aside: I wanted a 30-second timer in January because I was doing physical therapy stretching exercises then that were supposed to be held for 30 seconds. I’m not doing those exercises anymore, so I made a 3-minute timer for tea.)</p>
<p>Thanks to Dan for telling me about this. I had given up on this type of complication and wouldn’t have thought to look for the improvement.</p>
<hr/>
<p>Another improvement in 26.4—one that’s sort of mentioned in the <a href="https://support.apple.com/en-us/123002">release notes</a>—is that you no longer have to tap the small arrow button to start a workout. You can also tap anywhere in the big area around the exercise icon above the three bottom buttons on the Workouts screen. And you don’t have to wait for the arrow button to slowly animate into view.</p>
<p><img alt="Watch Workouts screen" class="ss" src="https://leancrew.com/all-this/images2026/20260329-Watch%20Workouts%20screen.png" title="Watch Workouts screen" width="40%"/></p>
<p>I bitched about the previous behavior—prompted by a <a href="https://mastodon.social/@agiletortoise/115741664171965520">Greg Pierce complaint</a>—<a href="https://leancrew.com/all-this/2025/12/watch-workout-widget-worse/">in December</a>. It’s almost as if Apple is listening now.</p>]]>
</content:encoded>
</item>

<item>
<title>Are you a mod or a rocker?</title>
<link>https://leancrew.com/all-this/2026/03/are-you-a-mod-or-a-rocker/</link>
<pubDate>Fri, 27 Mar 2026 23:07:06 +0000</pubDate>
<dc:creator>
  <![CDATA[Dr. Drang]]>
</dc:creator>
<guid>https://leancrew.com/all-this/2026/03/are-you-a-mod-or-a-rocker/</guid>
<description>
  <![CDATA[I’ve been working my way slowly through <a href="https://lccn.loc.gov/2017024295">Reingold and Dershowitz’s <em>Calendrical Calculations</em></a>. This week I hit Chapter 11 on the Mayan and Aztec calendars and came across a notation for modulo arithmetic that wasn’t familiar to me.<sup id="fnref:one"><a href="#fn:one" rel="footnote">1</a></sup> I figured I’d write about it here on the off-chance that any of you would find it interesting. Also, to make it stick in my head a little better.]]>
</description>
<content:encoded>
  <![CDATA[<p>[Equations in this post may not look right (or appear at all) in your RSS reader. Go to <a href="https://leancrew.com/all-this/2026/03/are-you-a-mod-or-a-rocker/">the original article</a> to see them rendered properly.]</p>
  <hr />
  <p>I’ve been working my way slowly through <a href="https://lccn.loc.gov/2017024295">Reingold and Dershowitz’s <em>Calendrical Calculations</em></a>. This week I hit Chapter 11 on the Mayan and Aztec calendars and came across a notation for modulo arithmetic that wasn’t familiar to me.<sup id="fnref:one"><a href="#fn:one" rel="footnote">1</a></sup> I figured I’d write about it here on the off-chance that any of you would find it interesting. Also, to make it stick in my head a little better.</p>
<p>The notation came up in the section on the <a href="https://www.mayan-calendar.com/ancient_haab.html">Haab calendar</a>, a sort of solar calendar that the Mayans used along with the <a href="https://www.mayan-calendar.com/ancient_tzolkin.html">Tzolk’in</a> and <a href="https://www.mayan-calendar.com/ancient_longcount.html">Long Count</a> calendars. The Haab calendar has 18 months of 20 days each and then a 19th sort-of-month with just 5 days. There’s no year number in the Haab calendar, so there’s no way to convert directly from the Haab calendar to other calendars. But there is a way to get a date in another calendar that’s on or nearest before a given Haab date.</p>
<p>Reingold and Dershowitz use a “fixed” or “RD” calendar as their way station between all the calendars. It’s a single day number that counts up from what would have been January 1 of the Year 1 in the Gregorian calendar if the Gregorian calendar had existed back then. In this system, 0001-01-01 is Day 1 and today, 2026-03-27, is Day 739,702.</p>
<p>The function that finds the closest given Haab date on or before a given fixed date is called <code>mayan-haab-on-or-before</code>, and it’s defined this way in the text:</p>
<p><img alt="Mayan Haab date function" class="ss" src="https://leancrew.com/all-this/images2026/20260327-Mayan%20Haab%20date%20function.jpg" title="Mayan Haab date function" width="100%"/></p>
<p>What’s odd about the modulo notation in this definition is that the thing after “mod” isn’t a divisor, it’s an interval: the half-open interval between <em>date</em> (inclusive) and <em>date</em> – 365 (exclusive).</p>
<p>Here’s how R&amp;D define this interval modulus, both in Chapter 1 of <em>Calendrical Calculations</em> and in <a href="https://dl.acm.org/doi/abs/10.1145/2421096.2421112">this ACM paper</a>:</p>
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mi>n</mi><mrow><mspace width="0.444em"></mspace><mrow><mi mathvariant="normal">mod</mi><mo>⁡</mo></mrow><mspace width="0.222em"></mspace><mo form="prefix" stretchy="false">[</mo></mrow><mn>a</mn><mspace width="0.167em"></mspace><mi>.</mi><mspace width="0.167em"></mspace><mi>.</mi><mspace width="0.167em"></mspace><mi>b</mi><mo form="postfix" stretchy="false">)</mo><mspace width="0.167em"></mspace><mover><mo>=</mo><mrow><mi mathvariant="normal">d</mi><mi mathvariant="normal">e</mi><mi mathvariant="normal">f</mi></mrow></mover><mspace width="0.167em"></mspace><mrow><mo form="prefix" stretchy="true">{</mo><mtable><mtr><mtd columnalign="left" style="text-align: left"><mi>a</mi><mo>+</mo><mo form="prefix" stretchy="false">(</mo><mi>n</mi><mo>−</mo><mi>a</mi><mo form="postfix" stretchy="false">)</mo><mrow><mspace width="0.444em"></mspace><mrow><mi mathvariant="normal">mod</mi><mo>⁡</mo></mrow><mspace width="0.222em"></mspace><mo form="prefix" stretchy="false">(</mo></mrow><mi>b</mi><mo>−</mo><mi>a</mi><mo form="postfix" stretchy="false">)</mo></mtd><mtd columnalign="left" style="text-align: left"><mspace width="0.222em"></mspace></mtd><mtd columnalign="left" style="text-align: left"><mrow><mtext mathvariant="normal">if </mtext><mspace width="0.333em"></mspace></mrow><mi>a</mi><mo>≠</mo><mi>b</mi></mtd></mtr><mtr><mtd columnalign="left" style="text-align: left"><mi>n</mi></mtd><mtd columnalign="left" style="text-align: left"><mspace width="0.222em"></mspace></mtd><mtd columnalign="left" style="text-align: left"><mrow><mtext mathvariant="normal">if </mtext><mspace width="0.333em"></mspace></mrow><mi>a</mi><mo>=</mo><mi>b</mi></mtd></mtr></mtable></mrow></mrow></math>
<p>As long as the two ends of the interval aren’t identical, the answer will lie in the range <math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mo form="prefix" stretchy="false">[</mo><mi>a</mi><mspace width="0.167em"></mspace><mi>.</mi><mspace width="0.167em"></mspace><mi>.</mi><mspace width="0.167em"></mspace><mi>b</mi><mo form="postfix" stretchy="false">)</mo></mrow></math>. This notation is helpful in shifted modulo operations like the one in <code>mayan-haab-on-or-before</code> because it explicitly tells you the range of answers you’ll get. The idea is that the resulting fixed date will be anywhere from 0 (inclusive) to 365 (exclusive) days before the given date.</p>
<p>(The normal modulo notation, <math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mi>n</mi><mrow><mspace width="0.444em"></mspace><mrow><mi mathvariant="normal">mod</mi><mo>⁡</mo></mrow><mspace width="0.222em"></mspace><mi>m</mi></mrow></mrow></math>, could be written as <math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mi>n</mi><mrow><mspace width="0.444em"></mspace><mrow><mi mathvariant="normal">mod</mi><mo>⁡</mo></mrow><mspace width="0.222em"></mspace><mo form="prefix" stretchy="false">[</mo></mrow><mn>0</mn><mspace width="0.167em"></mspace><mi>.</mi><mspace width="0.167em"></mspace><mi>.</mi><mspace width="0.167em"></mspace><mi>m</mi><mo form="postfix" stretchy="false">)</mo></mrow></math>, although this doesn’t seem particularly helpful.)</p>
<p>Note that in <code>mayan-haab-on-or-before</code>, the interval goes backward, which means the divisor in the standard mod function is a negative number: –365. If you’re implementing this function in a programming language, you have to make sure that using a negative divisor in your language’s <code>mod</code> will give you a negative answer. This means that <code>mod</code> must have a <a href="https://en.wikipedia.org/wiki/Modulo#Variants_of_the_definition"><em>floored</em> definition</a>. The <code>mod</code> function in Lisp, which R&amp;D are using, and the <code>%</code> operator in Python, which I’m using as I reimplement R&amp;D, both use the floored definition.</p>
<p>I mentioned earlier that the 19th month of the Haab calendar is an oddball because it has only 5 days. As it happens, today is smack in the middle of that 19th month, which is called Wayeb or Uayeb, depending on whose transliteration you use.</p>
<p>Another odd thing about the Haab calendar—something that computer programmers must love—is that the day numbers within a month start at 0, not 1. So Monday, which is the start of the next Haab cycle, will be 0 Pop, Pop being the name of the first Haab month.</p>
<div class="footnotes">
<hr/>
<ol>
<li id="fn:one">
<p>It would have been familiar if I’d read Chapter 1 carefully instead of skimming, but I was eager to get past the preliminaries quickly and figured I could always go back to Chapter 1 if necessary. Which it was. <a href="#fnref:one" rev="footnote">↩</a></p>
</li>
</ol>
</div>
  ]]>
</content:encoded>
</item>

<item>
<title>Saving us from ourselves?</title>
<link>https://leancrew.com/all-this/2026/03/saving-us-from-ourselves/</link>
<pubDate>Thu, 26 Mar 2026 21:06:30 +0000</pubDate>
<dc:creator>
  <![CDATA[Dr. Drang]]>
</dc:creator>
<guid>https://leancrew.com/all-this/2026/03/saving-us-from-ourselves/</guid>
<description>
  <![CDATA[You may have seen <a href="https://www.macrumors.com/2026/03/25/macos-26-4-terminal-security-feature/">this article</a> by Joe Rossignol in MacRumors yesterday. It’s about a new feature in macOS 26.4 that’s designed to keep us from pasting dangerous commands in Terminal. If a user pastes such a command, this warning pops up:]]>
</description>
<content:encoded>
  <![CDATA[<p>You may have seen <a href="https://www.macrumors.com/2026/03/25/macos-26-4-terminal-security-feature/">this article</a> by Joe Rossignol in MacRumors yesterday. It’s about a new feature in macOS 26.4 that’s designed to keep us from pasting dangerous commands in Terminal. If a user pastes such a command, this warning pops up:</p>
<p><img alt="macOS 26.4 command paste warning" class="ss" src="https://leancrew.com/all-this/images2026/20260326-macOS%2026.4%20command%20paste%20warning.jpg" title="macOS 26.4 command paste warning" width="50%"/></p>
<p>Near the end of the article, Rossignol says</p>
<blockquote>
<p>We have yet to determine exactly which commands trigger the warning, which does not always appear.</p>
</blockquote>
<p>I updated to 26.4 today and tried to trigger the warning. Since <code>rm -rf</code> is generally considered dangerous, I created some files I could try it out on.</p>
<p>Here are the commands I used in Terminal to create five new files, named <code>test1.txt</code> through <code>test5.txt</code>, in a folder named <code>test</code> and fill them with some nonsense text:</p>
<pre><code>$ mkdir test
$ touch test/test{1..5}.txt
$ pbcopy &lt;&lt;END
&gt; Same continent also, pre-occupation has probably played a more marked
influence; thus I can understand how it may be said, to be striving to the 
feral animals of South America) the black bear was seen by Hearne swimming 
for hours with widely open through an internal force beyond the other 
completed cells. It must suffice for our profound ignorance on the variations 
which have been.
&gt; END
$ for f in test/*; do pbpaste &gt;&gt; $f; done
</code></pre>
<p>The nonsense text in the <a href="https://www.gnu.org/software/bash/manual/bash.html#Here-Documents">here-document</a> was generated on the fly using <a href="https://leancrew.com/all-this/2011/02/dissociated-darwin/">my Dissociated Darwin script</a>. I used to call it via TextExpander; now it’s called via Typinator, but the process is the same.</p>
<p>I then created a simple HTML file with the command <code>rm -rf test</code> in its body and uploaded it to my server. Since websites were mentioned in the warning as a source of dangerous commands, I figured copying the command from an external site would be the most likely way to trigger the warning.</p>
<p>I aimed Safari at the file’s URL, copied the command, switched back to Terminal, and pasted. No warning popped up, and I was able to execute the pasted command and delete the folder and files with no trouble.</p>
<p>OK, let’s try something a little more convoluted. After recreating the <code>test</code> folder and files, I made a file named <code>dangerous.txt</code> and put it on my server. Its contents were simply <code>rm -rf test</code>. I then added this command to the HTML file described above:</p>
<pre><code>curl https://leancrew.com/dangerous/dangerous.txt | bash
</code></pre>
<p>Surely, I thought, a command that pipes the contents of some random file on the internet into <code>bash</code> for execution would be worth warning about. Nope. I copied the <code>curl</code> command from Safari, pasted it into Terminal, and hit Return. No warning from macOS and my test folder and files disappeared again.</p>
<p>My feelings about this have gone from “I hope Apple doesn’t make it impossible for me to work the way I normally do” to “Looks like Apple isn’t going overboard on the protection” to “Is there any protection here at all?”</p>
<p>Maybe there’s some setting on my system I changed long ago that’s now bypassing the warning. If so, I’d like to know what it is. Or maybe I just haven’t hit a high enough danger level yet. Which seems wrong.</p>]]>
</content:encoded>
</item>

<item>
<title>Hardware vs. software</title>
<link>https://leancrew.com/all-this/2026/03/hardware-vs-software/</link>
<pubDate>Thu, 19 Mar 2026 18:28:33 +0000</pubDate>
<dc:creator>
  <![CDATA[Dr. Drang]]>
</dc:creator>
<guid>https://leancrew.com/all-this/2026/03/hardware-vs-software/</guid>
<description>
  <![CDATA[I’ve been thinking about the new <a href="https://www.apple.com/studio-display/">Apple Studio Display</a> lately, mainly in the context of Jason Snell’s review of it on <a href="https://sixcolors.com/post/2026/03/2026-apple-studio-display-review-the-smallest-of-upgrades/">Six Colors</a> and his further discussion with Myke Hurley on <a href="https://www.relay.fm/upgrade/607">Upgrade</a>.]]>
</description>
<content:encoded>
  <![CDATA[<p>I’ve been thinking about the new <a href="https://www.apple.com/studio-display/">Apple Studio Display</a> lately, mainly in the context of Jason Snell’s review of it on <a href="https://sixcolors.com/post/2026/03/2026-apple-studio-display-review-the-smallest-of-upgrades/">Six Colors</a> and his further discussion with Myke Hurley on <a href="https://www.relay.fm/upgrade/607">Upgrade</a>.</p>
<p>Jason’s primary complaint about the Studio Display isn’t its high price or how little it’s improved over the 2022 version. It’s that the base stand—the one you get for $1600—has no height adjustment. To get the ergonomic benefit of height adjustment, you need to buy either the VESA mount adapter (and an arm if you don’t already have one) or the exquisite height-adjustable stand, which is a $400 addition.</p>
<p><img alt="Height-adjustable Studio Display in profile" class="ss" src="https://leancrew.com/all-this/images2026/20260319-Height-adjustable%20Studio%20Display%20in%20profile.jpg" title="Height-adjustable Studio Display in profile" width="30%"/></p>
<p>It’s hard to argue with Jason when he says this:</p>
<blockquote>
<p>Apple claims it’s a champion of accessibility. But in my opinion, part of accessibility is ergonomics. Different people need displays at different heights, and we are all shaped differently. Apple’s continued insistence on shipping displays and iMacs that aren’t height-adjustable by default is frustrating. You spend all this money on a pricey Apple display and then, what, put it on an old dictionary? Meanwhile, even the cut-rate competition offers height adjustments.</p>
</blockquote>
<p>The “old dictionary” comment reminded me that in the days of CRT monitors, I—and many of the people I worked with—used the <em>CRC Handbook of Chemistry and Physics</em> to bring our monitors up to the proper height. We all agreed it was the best use we’d ever gotten out of that book.</p>
<p>And that experience my friends and I had with the <em>CRC Handbook</em> points to an important fact about monitor height adjustment: for most people, it’s a set-it-and-forget-it feature. You get your monitor to a height that works well with your desk setup, and you don’t change it for ages. The smooth fingertip control Apple provides with its upgraded stand—while undoubtedly useful for some—isn’t the kind of ergonomic help that most customers need.</p>
<p>What Apple’s doing here is the opposite of what it does on the software side. Most Apple apps are built to be good enough for the great bulk of its users. People who need more—in a calendar, a mail client, a to-do manager, a spreadsheet, a word processor, and so on—go to third-party apps to get those extra features.</p>
<p>This has served both Apple and its customers well. Even those of us who consider ourselves power users aren’t power users across the whole gamut of computing. We use a mix of basic and advanced apps to match our needs. Apple doesn’t have to stay on the cutting edge of all its many software products, and we get free apps that handle a lot of what we do.</p>
<p>Maybe Apple thinks its basic stand has been designed to hit that sweet spot for the vast majority of its users. Maybe they’ve spent considerable time and money on studies of desks and chairs and torsos and have come up with a single monitor height that’s “just fine.” I hope not, because that money would’ve been better spent on a simpler and less beautiful height-adjustable stand.</p>]]>
</content:encoded>
</item>

<item>
<title>A leap year inequality</title>
<link>https://leancrew.com/all-this/2026/03/a-leap-year-inequality/</link>
<pubDate>Sun, 15 Mar 2026 23:22:53 +0000</pubDate>
<dc:creator>
  <![CDATA[Dr. Drang]]>
</dc:creator>
<guid>https://leancrew.com/all-this/2026/03/a-leap-year-inequality/</guid>
<description>
  <![CDATA[I’ve been working my way through the fourth edition of Reingold and Dershowitz’s <a href="https://lccn.loc.gov/2017024295"><em>Calendrical Calculations</em></a>, and I want to talk about something I learned.]]>
</description>
<content:encoded>
  <![CDATA[<p>[Equations in this post may not look right (or appear at all) in your RSS reader. Go to <a href="https://leancrew.com/all-this/2026/03/a-leap-year-inequality/">the original article</a> to see them rendered properly.]</p>
  <hr />
  <p>I’ve been working my way through the fourth edition of Reingold and Dershowitz’s <a href="https://lccn.loc.gov/2017024295"><em>Calendrical Calculations</em></a>, and I want to talk about something I learned.</p>
<p><img alt="Calendrical Calculations book cover" class="ss" src="https://leancrew.com/all-this/images2026/20260315-Calendrical%20Calculations%20book%20cover.jpg" title="Calendrical Calculations book cover" width="60%"/></p>
<p>It’s a simple inequality that initially appears in the first chapter of the book and gets used several times thereafter. Here it is:</p>
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mi>ℓ</mi><mspace width="0.167em"></mspace><mo form="prefix" stretchy="false">(</mo><mi>y</mi><mo>+</mo><mi mathvariant="normal">Δ</mi><mo form="postfix" stretchy="false">)</mo><mrow><mspace width="0.444em"></mspace><mrow><mi mathvariant="normal">mod</mi><mo>⁡</mo></mrow><mspace width="0.222em"></mspace><mi>c</mi></mrow><mo>&lt;</mo><mi>ℓ</mi></mrow></math>
<p>It’s first presented as a way to figure out how leap years are distributed. In some calendars—<em>not</em> the Gregorian—there’s a repeating cycle of <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>c</mi></math> years in which <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>ℓ</mi></math> years are leap years. If the leap years are distributed as evenly as possible, then the years in which <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>y</mi></math> satisfies the inequality are the leap years. The <math xmlns="http://www.w3.org/1998/Math/MathML"><mi mathvariant="normal">Δ</mi></math> is a sort of offset that determines the position within the cycle associated with Year 0, and the <math xmlns="http://www.w3.org/1998/Math/MathML"><mi mathvariant="normal">mod</mi></math> operator represents <a href="https://en.wikipedia.org/wiki/Modulo">modulo division</a>. In Python, that’s the <code>%</code> operator.</p>
<p>It’s helpful to look at examples. Let’s say we have a 7-year cycle with 2 leap years and 5 normal years in each cycle. The leap years have to be either 3 or 4 years apart. Here’s an example showing three cycles:</p>
<pre><code>                       1 1 1 1 1 1 1 1 1 1 2 2
Year 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
Type N N N L N N L N N N L N N L N N N L N N L
</code></pre>
<p>For this, <math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mi>c</mi><mo>=</mo><mn>7</mn></mrow></math>, <math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mi>ℓ</mi><mo>=</mo><mn>2</mn></mrow></math>, and <math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mi mathvariant="normal">Δ</mi><mo>=</mo><mn>0</mn></mrow></math>. You can plug the values into the inequality to show that it’s satisfied for years 4, 7, 11, 14, 18, 21, and so on.</p>
<p>Here’s a similar example. The only difference is the offset. In this case, <math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mi mathvariant="normal">Δ</mi><mo>=</mo><mn>2</mn></mrow></math>, and the leap years are years 2, 5, 9, 12, 16, 19, and so on.</p>
<pre><code>                       1 1 1 1 1 1 1 1 1 1 2 2
Year 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
Type N L N N L N N N L N N L N N N L N N L N N
</code></pre>
<p>A practical example of this formula is with the Hebrew calendar. It has a 19-year cycle (<math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mi>c</mi><mo>=</mo><mn>19</mn></mrow></math>) with 7 leap years (<math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mi>ℓ</mi><mo>=</mo><mn>7</mn></mrow></math>), and the offset is 11 years (<math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mi mathvariant="normal">Δ</mi><mo>=</mo><mn>11</mn></mrow></math>). The current year is 5786, for which</p>
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mn>7</mn><mspace width="0.167em"></mspace><mo form="prefix" stretchy="false">(</mo><mn>5786</mn><mo>+</mo><mn>11</mn><mo form="postfix" stretchy="false">)</mo><mrow><mspace width="0.444em"></mspace><mrow><mi mathvariant="normal">mod</mi><mo>⁡</mo></mrow><mspace width="0.222em"></mspace><mn>19</mn></mrow><mo>=</mo><mn>14</mn><mo>≥</mo><mn>7</mn></mrow></math>
<p>so this is not a leap year. But for next year,</p>
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mn>7</mn><mspace width="0.167em"></mspace><mo form="prefix" stretchy="false">(</mo><mn>5787</mn><mo>+</mo><mn>11</mn><mo form="postfix" stretchy="false">)</mo><mrow><mspace width="0.444em"></mspace><mrow><mi mathvariant="normal">mod</mi><mo>⁡</mo></mrow><mspace width="0.222em"></mspace><mn>19</mn></mrow><mo>=</mo><mn>2</mn><mo>&lt;</mo><mn>7</mn></mrow></math>
<p>so it <em>is</em> a leap year and will have 13 months instead of 12. You can confirm this on any number of websites; the key is to note that 5787 has both an Adar I and an Adar II.</p>
<p>The Gregorian calendar has a 400-year cycle with 97 leap years, but those leap years are <em>not</em> distributed as evenly as possible, so the formula can’t be used. If it had been used, we’d have leap years typically every fourth year but occasionally every fifth year. Pope Gregory and his people must’ve thought that would be too tricky to deal with.</p>
<p>Surprisingly (to me, anyway), Reingold and Dershowitz <em>do</em> use this formula with the Gregorian calendar, but they use it with months instead of years. Think of the months in the Gregorian calendar as being either short or long. In a year, there are 5 short months and 7 long months, and they’re distributed like this:</p>
<pre><code>                          1 1 1
        1 2 3 4 5 6 7 8 9 0 1 2
Month   J F M A M J J A S O N D
Length  L S L S L S L L S L S L
</code></pre>
<p>The positions of the long months correspond to our inequality with <math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mi>c</mi><mo>=</mo><mn>12</mn></mrow></math>, <math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mi>ℓ</mi><mo>=</mo><mn>7</mn></mrow></math>, and <math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mi mathvariant="normal">Δ</mi><mo>=</mo><mn>11</mn></mrow></math>. Plug in those values, and you’ll see that the long months are 1, 3, 5, 7, 8, 10, and 12.</p>
<p>To calculate the day number within a year, it’s usually easiest to calculate the number of days in the preceding months and then add the day number within the current month. Today is March 15, so it’s Day <math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mo form="prefix" stretchy="false">(</mo><mn>31</mn><mo>+</mo><mn>28</mn><mo form="postfix" stretchy="false">)</mo><mo>+</mo><mn>15</mn><mo>=</mo><mn>74</mn></mrow></math> of the year.</p>
<p>Instead of looping through the lengths of the preceding months, R&amp;D use a formula based on our inequality to count the number of long months before the current month. That formula is</p>
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mrow><mo form="prefix" stretchy="true">⌊</mo><mfrac><mrow><mi>ℓ</mi><mspace width="0.167em"></mspace><mo form="prefix" stretchy="false">(</mo><mi>m</mi><mo>+</mo><mi mathvariant="normal">Δ</mi><mo>-</mo><mn>1</mn><mo form="postfix" stretchy="false">)</mo></mrow><mi>c</mi></mfrac><mo form="postfix" stretchy="true">⌋</mo></mrow><mo>−</mo><mrow><mo form="prefix" stretchy="true">⌊</mo><mfrac><mrow><mi>ℓ</mi><mi mathvariant="normal">Δ</mi></mrow><mi>c</mi></mfrac><mo form="postfix" stretchy="true">⌋</mo></mrow></mrow></math>
<p>where the brackets without tops represent the <a href="https://mathworld.wolfram.com/FloorFunction.html">floor function</a>, i.e., the integer equal to or just below what’s inside the brackets.</p>
<p>Plugging in our values for <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>c</mi></math>, <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>ℓ</mi></math>, and <math xmlns="http://www.w3.org/1998/Math/MathML"><mi mathvariant="normal">Δ</mi></math> and doing some algebra, we get</p>
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mo form="prefix" stretchy="true">⌊</mo><mfrac><mrow><mn>7</mn><mi>m</mi><mo>−</mo><mn>2</mn></mrow><mn>12</mn></mfrac><mo form="postfix" stretchy="true">⌋</mo></mrow></math>
<p>This is the number of long months in the year before the current month <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>m</mi></math>.</p>
<p>If February had 30 days, the number of days in the months before the current month would be</p>
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mn>30</mn><mspace width="0.167em"></mspace><mo form="prefix" stretchy="false">(</mo><mi>m</mi><mo>−</mo><mn>1</mn><mo form="postfix" stretchy="false">)</mo><mo>+</mo><mrow><mo form="prefix" stretchy="true">⌊</mo><mfrac><mrow><mn>7</mn><mi>m</mi><mo>−</mo><mn>2</mn></mrow><mn>12</mn></mfrac><mo form="postfix" stretchy="true">⌋</mo></mrow><mo>=</mo><mrow><mo form="prefix" stretchy="true">⌊</mo><mfrac><mrow><mn>367</mn><mi>m</mi><mo>−</mo><mn>362</mn></mrow><mn>12</mn></mfrac><mo form="postfix" stretchy="true">⌋</mo></mrow></mrow></math>
<p>So to get the (Gregorian) day of the year, R&amp;D calculate the day number as if February had 30 days and then subtract (if necessary) to account for February’s deficiency. In Python, the code looks like this:</p>
<pre><code>python:
def day_of_year(year, month, day):
  year_day = (367 * month - 362) // 12 + day
  if month &lt;= 2:
    return year_day
  elif leap_year(year):
    return year_day - 1
  else:
    return year_day - 2
</code></pre>
<p>where I’m assuming we already have a Boolean function <code>leap_year</code> to determine whether it’s a leap year or not. That’s not necessarily the most obvious code in the world, but it makes sense if you’ve gone through the derivation.</p>
<p>One last thing. Reingold is the co-author of <a href="https://iccl.inf.tu-dresden.de/w/images/9/92/Harris-ACM2004.pdf">a paper</a> in which our inequality is connected to <a href="https://en.wikipedia.org/wiki/Euclidean_algorithm">Euclid’s algorithm</a> for calculating the greatest common divisor and <a href="https://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm">Bresenham’s algorithm</a> for plotting lines on bitmaps. Which is pretty cool.</p>
  ]]>
</content:encoded>
</item>

<item>
<title>Scientific American and Friday the 13th</title>
<link>https://leancrew.com/all-this/2026/03/scientific-american-and-friday-the-13th/</link>
<pubDate>Fri, 13 Mar 2026 23:48:46 +0000</pubDate>
<dc:creator>
  <![CDATA[Dr. Drang]]>
</dc:creator>
<guid>https://leancrew.com/all-this/2026/03/scientific-american-and-friday-the-13th/</guid>
<description>
  <![CDATA[<em>Scientific American</em> has <a href="https://www.scientificamerican.com/article/why-friday-the-13th-is-a-mathematical-inevitability/">a fun little article</a> today about the frequency of Friday the 13ths. It ends with this table,]]>
</description>
<content:encoded>
  <![CDATA[<p><em>Scientific American</em> has <a href="https://www.scientificamerican.com/article/why-friday-the-13th-is-a-mathematical-inevitability/">a fun little article</a> today about the frequency of Friday the 13ths. It ends with this table,</p>
<p><img alt="SciAm 13th table" class="ss" src="https://leancrew.com/all-this/images2026/20260313-SciAm%2013th%20table.png" title="SciAm 13th table" width="100%"/></p>
<p>and this true but overstated conclusion:</p>
<blockquote>
<p>In other words, the 13th of a month will be a Friday more times than any other day of the week.</p>
</blockquote>
<p>Well, yes, if you live to be 400 years old, you’ll see one more Friday the 13th than Wednesday the 13ths or Sunday the 13ths. Kind of a weird thing to focus on, though. I’m guessing you’ll have other worries by then.</p>
<p>But I shouldn’t be so snarky. A few years ago, <a href="https://leancrew.com/all-this/2023/10/friday-the-13th-comes-on-a-friday-this-month/">I wrote a post</a> that calculated the same set of Fri13 counts for a 400-year Gregorian cycle. I did the calculations in Mathematica and (of course) showed the code. Today, I did the same thing in Python,</p>
<pre><code>python:
 1:  #!/usr/bin/env python
 2:  
 3:  from datetime import date
 4:  
 5:  f13s = [0]*7
 6:  for y in range(1800, 2200):
 7:    for m in range(1, 13):
 8:      wd = date(y, m, 13).weekday()
 9:      f13s[wd] += 1
10:  
11:  print(f13s)
</code></pre>
<p>and got a result of</p>
<pre><code>[685, 685, 687, 684, 688, 684, 687]
</code></pre>
<p>for Monday through Sunday. This also matches the SciAm table.</p>
<p>Those of us who are alive now (and have realistic longevities) won’t live through any non-leap century years. For us, the calendar has and will repeat every 28 years (1461 weeks), and over every 28-year period in our lives, there will be 48 Fri13s, the same as the number of Mon13s, Tue13s, Wed13s, and so on.</p>
<p>Of course, few of us live exactly a multiple of 28 years. Personally, I’ve lived through 113 Fri13s so far, which is just under the number of Sun13s I’ve seen (114). So I’ve been lucky?</p>
<p>In a Friday the 13th post from <a href="https://leancrew.com/all-this/2012/07/friday-the-13th-frequency/">way back in 2012</a>, I talked about how Fri13s repeat within years because the number of days in certain month sequences is a multiple of 7. So if there’s a Fri13 in April, there will be another in July because</p>
<pre><code>Apr + May + Jun
30  + 31  + 30  = 91
</code></pre>
<p>which is 13 weeks. The last time that happened was in 2018.</p>
<p>Similarly, if there’s a Fri13 in September, there will also be one in December because</p>
<pre><code>Sep + Oct + Nov
30  + 31  + 30  = 91
</code></pre>
<p>That pair of Fri13s last happened in 2024.</p>
<p>There’s also an 8-month sequence that adds to a multiple of 7:</p>
<pre><code>Mar + Apr + May + Jun + Jul + Aug + Sep + Oct
31  + 30  + 31  + 30  + 31  + 31  + 30  + 31  = 245
</code></pre>
<p>So there will be another Fri13 in November of this year.</p>
<p>The sequences above happen every year. In non-leap years only—this year, for example—a Fri13 in February will be followed by one in March. In leap years only, a Fri13 in January will be followed by one in April. That last happened in 2012.</p>
<p>I covered all these repeated Fri13s in <a href="https://leancrew.com/all-this/2012/07/friday-the-13th-frequency/">that 2012 post</a>. Today, I learned of a new repeat that spans certain year boundaries. If there’s a Fri13 in December of a non-leap year that’s followed by a leap year, there will be a Fri13 in March of that following year. That last happened in December of 2019 and March of 2020.</p>
<p>Superstitious or not, you have to admit March of 2020 was pretty unlucky.</p>]]>
</content:encoded>
</item>

<item>
<title>Port ability</title>
<link>https://leancrew.com/all-this/2026/03/port-ability/</link>
<pubDate>Wed, 11 Mar 2026 00:53:12 +0000</pubDate>
<dc:creator>
  <![CDATA[Dr. Drang]]>
</dc:creator>
<guid>https://leancrew.com/all-this/2026/03/port-ability/</guid>
<description>
  <![CDATA[I read <a href="https://sixcolors.com/post/2026/03/macbook-neo-review/">Jason Snell’s review</a> of the MacBook Neo this morning and was struck by this section on its two USB-C ports:]]>
</description>
<content:encoded>
  <![CDATA[<p>I read <a href="https://sixcolors.com/post/2026/03/macbook-neo-review/">Jason Snell’s review</a> of the MacBook Neo this morning and was struck by this section on its two USB-C ports:</p>
<blockquote>
<p>So Apple has done the work to put two USB-C ports on the Neo—and those ports reveal a bit more of the struggles Apple had in building this computer. Both of the USB-C ports will let you charge (which is good, because there’s no MagSafe), but only the one that’s furthest back is a fully functional USB 3 port with support for driving an external display at 4K, 60 frames per second. The closer-in USB port only offers USB 2 speeds. (The good news is that Apple has built alerts into macOS that will warn you if the device you’ve plugged into the slow port would be better off plugged into the faster one, so you won’t be transferring files slowly unnecessarily.)</p>
</blockquote>
<p>It reminded me of <a href="https://mastodon.social/@film_girl/116172541746813426?kjy=spring">Christina Warren’s angry Mastodon post</a> about the Neo’s ports:</p>
<blockquote>
<p>I’m just going to say that pointing out flaws in $600 and $700 laptops and having people instinctively respond “it’s not for real users, these buyers don’t know/care” is gross. Why should we make the assumption that those buyers don’t still deserve better, or at least on par with the 6 year old product it’s replacing that sold at the same price. Stop assuming people who don’t spend $1000+ on tech are imbeciles or deserve subpar options. No one in 2026 deserves a laptop with a single USB 3 port.</p>
</blockquote>
<p>My first thought upon reading Christina’s complaint last week was “Why should I care about the configuration of a computer I’ll never buy?” Kind of a Republican thought, I admit, and I’m not proud of it. But I have many reasons to be disappointed by Apple, and I need to conserve my outrage. Christina’s much younger than I am and has deeper outrage reserves.</p>
<p>Jason pointed out the biggest problem with the low-speed port in his next paragraph:</p>
<blockquote>
<p>Honestly, I’m more disappointed by the fact that mismatched ports can lead to user frustration—no, not that port, the other one—than I am about the one slow USB port.</p>
</blockquote>
<p>Many Neo users will be too young to remember the joy of flipping USB-A plugs back and forth before getting the orientation right. Apple has updated that wonderful experience for the USB-C age.</p>]]>
</content:encoded>
</item>

<item>
<title>Lent and Lisp</title>
<link>https://leancrew.com/all-this/2026/02/lent-and-lisp/</link>
<pubDate>Wed, 25 Feb 2026 15:13:32 +0000</pubDate>
<dc:creator>
  <![CDATA[Dr. Drang]]>
</dc:creator>
<guid>https://leancrew.com/all-this/2026/02/lent-and-lisp/</guid>
<description>
  <![CDATA[After writing <a href="https://leancrew.com/all-this/2026/02/chinese-new-year-and-ramadan/">last week’s post</a> about the start of Ramadan and Chinese New Year, I expected to hear from people asking why I didn’t include the further coincidence of Ash Wednesday. I was surprised that the only such feedback I got was an email from <a href="https://rhymeswithdiploma.com/">TJ Luoma</a>. It makes sense that Lent would be on TJ’s mind—it’s a big part of his business calendar—but I had an answer prepared, and I wrote him back with my reasons.]]>
</description>
<content:encoded>
  <![CDATA[<p>After writing <a href="https://leancrew.com/all-this/2026/02/chinese-new-year-and-ramadan/">last week’s post</a> about the start of Ramadan and Chinese New Year, I expected to hear from people asking why I didn’t include the further coincidence of Ash Wednesday. I was surprised that the only such feedback I got was an email from <a href="https://rhymeswithdiploma.com/">TJ Luoma</a>. It makes sense that Lent would be on TJ’s mind—it’s a big part of his business calendar—but I had an answer prepared, and I wrote him back with my reasons.</p>
<p>As I typed out the reply, though, the reasons seemed weaker. Yes, it’s true that the full moon that determines this year’s <a href="https://aa.usno.navy.mil/faq/easter">date of Easter</a> (and therefore Ash Wednesday) isn’t part of the same lunation that determines the start of Ramadan and Chinese New Year, so there was an astronomical reason to keep Ash Wednesday out of the post. But it’s also true that both Ramadan and Lent represent periods of self-denial, so there’s a cultural connection.</p>
<p>Adding a new bit of Emacs Lisp code to what I’d already written to include a check for Ash Wednesday wouldn’t be hard, but another thought was buzzing in my head: switching from Emacs Lisp to Common Lisp. The ELisp calendar functions were written by Edward Reingold and Nachum Dershowitz, authors of the well-known <a href="https://lccn.loc.gov/2017024295"><em>Calendrical Calculations</em></a>. That book includes <a href="https://www.cambridge.org/us/universitypress/subjects/computer-science/computing-general-interest/calendrical-calculations-ultimate-edition-4th-edition?format=HB#resources">a lot of code</a> that isn’t in the Emacs implementation, code that does astronomical calculations I’d like to explore. So it seemed like a good idea to write a Ramadan/Lent/Chinese New Year script in Common Lisp and use the functions from the book.</p>
<p>The problem with that idea was that the Common Lisp code I downloaded from the <a href="https://www.cambridge.org/us/universitypress/subjects/computer-science/computing-general-interest/calendrical-calculations-ultimate-edition-4th-edition?format=HB#resources">Cambridge University Press site</a>, <code>calendar.l</code>, didn’t work. I tried it in both <a href="https://www.sbcl.org/">SBCL</a> and <a href="https://clisp.sourceforge.io/">CLISP</a>, and calling</p>
<pre><code>(load "calendrical.l")
</code></pre>
<p>threw a huge number of errors. I was, it turned out, not the first to have <a href="https://stackoverflow.com/questions/72716454/start-working-with-large-lisp-library-calendrical-calculations">run into this problem</a>. The workarounds suggested there on Stack Overflow didn’t help. There’s <a href="https://elangocheran.com/2023/12/06/calendars-and-usable-calendrical-calculations-code/">a port to Clojure</a> that apparently works, but I was reluctant to use <a href="https://clojure.org/">Clojure</a> and have to maintain both it and a Java Virtual Machine.</p>
<p>What I found, though, was that Reingold &amp; Dershowitz’s code would load in CLISP with one simple change. After many lines of comments, the working part of <code>calendar.l</code> starts with these lines:</p>
<pre><code>(in-package "CC4")

(export '(
          acre
          advent
          akan-day-name
          akan-day-name-on-or-before

          [and so on for a few hundred lines]

          yom-ha-zikkaron
          yom-kippur
          zone
          ))
</code></pre>
<p>Deleting these lines got me a file that would load without errors in CLISP,<sup id="fnref:sbcl"><a href="#fn:sbcl" rel="footnote">1</a></sup> so I named the edited version <code>calendar.lisp</code> and saved it in my <code>~/lisp/</code> directory. I believe the problem with the unedited code has something to do with packages and namespaces, and if I keep using Common Lisp long enough, I may learn how to make a better fix. Until then, this will do.</p>
<p>With a working library of calendar code, I wrote the following script, <code>ramadan-lent</code>, to get the dates for which Ramadan 1 and Ash Wednesday correspond over a 500-year period:</p>
<pre><code> 1:  #! /usr/bin/env clisp -q
 2:  
 3:  ;; The edited Calendrical Calculations code by Reingold and Dershowitz
 4:  (load "calendar.lisp")
 5:  
 6:  ;; Names
 7:  (setq
 8:    weekday-names
 9:    '("Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday" "Saturday")
10:  
11:    gregorian-month-names
12:    '("January" "February" "March" "April" "May" "June"
13:      "July" "August" "September" "October" "November" "December"))
14:  
15:  ;; Date string function
16:  (defun gregorian-date-string (date)
17:    (let ((g-date (gregorian-from-fixed date))
18:          (weekday (day-of-week-from-fixed date)))
19:      (format nil "~a, ~a ~d, ~d"
20:        (nth weekday weekday-names)
21:        (nth (1- (second g-date)) gregorian-month-names)
22:        (third g-date)
23:        (first g-date))))
24:  
25:  ;; Get today's (Gregorian) date.
26:  (multiple-value-setq
27:    (t-second t-minute t-hour t-day t-month t-year t-weekday t-dstp t-tz)
28:    (get-decoded-time))
29:    
30:  ;; Loop through 500 Islamic years, from 250 years ago to 250 years in
31:  ;; the future and find each Ramadan 1 that corresponds to Ash Wednesday.
32:  ;; Print as a Gregorian date.
33:  (setq
34:    f (fixed-from-gregorian (list t-year t-month t-day))
35:    ti-year (first (islamic-from-fixed f)))
36:  (dotimes (i 500)
37:    (setq iy (+ (- ti-year 250) i)
38:          r (fixed-from-islamic (list iy 9 1))
39:          g-year (gregorian-year-from-fixed r)
40:          aw (- (easter g-year) 46))
41:    (if (equal aw r)
42:      (format t "~a~%" (gregorian-date-string r))))
</code></pre>
<p>The <code>-q</code> in the shebang line tells CLISP not to put up its typical welcome banner. I had to write my own <code>gregorian-date-string</code> function (Lines 16–23) because <code>calendrical.lisp</code> doesn’t have one, but it was pretty easy.</p>
<p>In fact, it was all pretty easy. I haven’t programmed in Lisp or Scheme in quite a while, but I quickly remembered how fun it is. The only tricky bits were:</p>
<ul>
<li>learning how to handle the multiple value output of <code>get-decoded-time</code> (Lines 26–28);</li>
<li>remembering how to handle more than one variable assignment in <code>setq</code>; and</li>
<li>recognizing that what the ELisp calendar library calls “absolute” dates, the Common Lisp calendar library calls “fixed” dates.</li>
</ul>
<p>R&amp;D’s library has an <code>easter</code> function for getting the date of Easter for a given (Gregorian) year; Line 40 gets the date of the associated Ash Wednesday by going back 46 days from Easter.</p>
<p>The output of <code>ramadan-lent</code> was</p>
<pre><code>Wednesday, February 6, 1799
Wednesday, February 24, 1830
Wednesday, February 22, 1928
Wednesday, February 18, 2026
Wednesday, March 7, 2057
Wednesday, February 16, 2124
Wednesday, March 5, 2155
Wednesday, February 13, 2222
Wednesday, March 2, 2253
</code></pre>
<p>The most common gap between successive correspondences was 98 years, but there were occasional gaps of 31 and 67 years.</p>
<p>It took only a few extra lines at the end to include a check for Chinese New Year. Here’s <code>ramadan-lent-new-year</code>:</p>
<pre><code> 1:  #! /usr/bin/env clisp -q
 2:  
 3:  ;; The edited Calendrical Calculations code by Reingold and Dershowitz
 4:  (load "calendar.lisp")
 5:  
 6:  ;; Names
 7:  (setq
 8:    weekday-names
 9:    '("Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday" "Saturday")
10:  
11:    gregorian-month-names
12:    '("January" "February" "March" "April" "May" "June"
13:      "July" "August" "September" "October" "November" "December"))
14:  
15:  ;; Date string function
16:  (defun gregorian-date-string (date)
17:    (let ((g-date (gregorian-from-fixed date))
18:          (weekday (day-of-week-from-fixed date)))
19:      (format nil "~a, ~a ~d, ~d"
20:        (nth weekday weekday-names)
21:        (nth (1- (second g-date)) gregorian-month-names)
22:        (third g-date)
23:        (first g-date))))
24:  
25:  ;; Get today's (Gregorian) date.
26:  (multiple-value-setq
27:    (t-second t-minute t-hour t-day t-month t-year t-weekday t-dstp t-tz)
28:    (get-decoded-time))
29:    
30:  ;; Loop through 500 Islamic years, from 250 years ago to 250 years in
31:  ;; the future and find each Ramadan 1 that corresponds to Ash Wednesday
32:  ;; and Chinese New Year.
33:  ;; Print as a Gregorian date.
34:  (setq
35:    f (fixed-from-gregorian (list t-year t-month t-day))
36:    ti-year (first (islamic-from-fixed f)))
37:  (dotimes (i 500)
38:    (setq iy (+ (- ti-year 250) i)
39:          r (fixed-from-islamic (list iy 9 1))
40:          g-year (gregorian-year-from-fixed r)
41:          aw (- (easter g-year) 46))
42:    (if (equal aw r)
43:      (let ((ny (chinese-new-year-on-or-before r)))
44:        (if (equal ny (1- r))
45:          (format t "~a~%" (gregorian-date-string r))))))
</code></pre>
<p>The <code>chinese-new-year-on-or-before</code> function (Line 43), which is in the library to aid in the writing of the typically more useful <code>chinese-from-fixed</code> function, turned out to be just what I needed here. It gets me the fixed date of Chinese New Year that’s on or before Ramadan 1. I then check to see if that’s exactly one day before Ramadan 1 in Line 44.</p>
<p>This script’s output was</p>
<pre><code>Wednesday, February 6, 1799
Wednesday, February 18, 2026
Wednesday, February 16, 2124
Wednesday, February 13, 2222
</code></pre>
<p>We see that last week’s triple correspondence hadn’t occurred in 227 years, and it’ll be another 98 years before the next one. Thanks to TJ for getting me to look into this rare event.</p>
<p>I’ve had a copy of the second edition of <em>Calendrical Calculations</em> (called the <em>Millenium Edition</em> because it came out in 2001) for over twenty years. As I was fiddling with <code>ramadan-lent</code> and <code>ramadan-lent-new-year</code>, I ordered the fourth (or <em>Ultimate</em>) edition so I’d have the best reference on the functions in <code>calendar.lisp</code>. You can expect more posts on calendars and astronomical events as I dig into it.</p>
<div class="footnotes">
<hr/>
<ol>
<li id="fn:sbcl">
<p>Not in SBCL, unfortunately. As best as I can tell, SBCL wants every function to be defined in terms of previously defined functions, and R&amp;D didn’t write their code that way. CLISP is more forgiving in the order of definitions. <a href="#fnref:sbcl" rev="footnote">↩</a></p>
</li>
</ol>
</div>]]>
</content:encoded>
</item>

<item>
<title>My OmniGraffle ticks</title>
<link>https://leancrew.com/all-this/2026/02/my-omnigraffle-ticks/</link>
<pubDate>Fri, 20 Feb 2026 17:40:43 +0000</pubDate>
<dc:creator>
  <![CDATA[Dr. Drang]]>
</dc:creator>
<guid>https://leancrew.com/all-this/2026/02/my-omnigraffle-ticks/</guid>
<description>
  <![CDATA[I thought some of you might be wondering about the dimensions on this drawing from <a href="https://leancrew.com/all-this/2026/02/easy-to-be-hard/">yesterday’s post</a>:]]>
</description>
<content:encoded>
  <![CDATA[<p>[Equations in this post may not look right (or appear at all) in your RSS reader. Go to <a href="https://leancrew.com/all-this/2026/02/my-omnigraffle-ticks/">the original article</a> to see them rendered properly.]</p>
  <hr />
  <p>I thought some of you might be wondering about the dimensions on this drawing from <a href="https://leancrew.com/all-this/2026/02/easy-to-be-hard/">yesterday’s post</a>:</p>
<p><img alt="Radii relationship" class="ss" src="https://leancrew.com/all-this/images2026/20260219-Radii%20relationship.png" title="Radii relationship" width="50%"/></p>
<p>Don’t be offended—I trust you all to know why the horizontal components of the two diagonals are <math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><msub><mi>r</mi><mn>0</mn></msub><mi>/</mi><msqrt><mn>2</mn></msqrt></mrow></math> and <math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><msub><mi>r</mi><mn>1</mn></msub><mi>/</mi><msqrt><mn>2</mn></msqrt></mrow></math>. What I thought you might be questioning was my use of short diagonal ticks instead of arrowheads on the dimension lines along the bottom of the drawing.</p>
<p>This is a style I picked up as an undergrad. I use it all the time in hand-drawn sketches, and I think I’m going to use it here from now on. The first person I saw using this kind of dimension line was <a href="https://modernize.cee.illinois.edu/spaces/article/47912">John Haltiwanger</a>, who taught the second structural analysis class I took, and I adopted it in emulation of him. I mentioned Prof. Haltiwanger and his insistence on good sketches in <a href="https://leancrew.com/all-this/2025/11/a-sense-of-structure/">this post</a> last year.</p>
<p>There are two advantages to using ticks instead of arrowheads: speed and clarity. The speed advantage is obvious. Clarity comes in drawings of structural problems, where we use arrowheads to represent forces. Although it’s usually clear from context which lines are for forces and which are for dimensions, sometimes the two cross or are close enough to one another that it helps to use different ends. This is especially true when sketching on paper or a blackboard, where you can’t use line thickness to distinguish between the two.</p>
<p>Let’s say I’m going to analyze a simply supported beam with a uniformly distributed load across its entire length and a concentrated load at its center. I’d sketch it this way in my notebook:</p>
<p><img alt="Simply-supported beam sketch" class="ss" src="https://leancrew.com/all-this/images2026/20260220-Simply-supported%20beam%20sketch.jpg" title="Simply-supported beam sketch" width="80%"/></p>
<p>After drawing the beam, supports, and forces, I make the vertical leader lines, one long dimension line the full length of the beam, and then three quick diagonal ticks.</p>
<p>If I’m going to blog about it, I’ll turn it into a nicer drawing in <a href="https://www.omnigroup.com/omnigraffle">OmniGraffle</a>:</p>
<p><img alt="Simply-supported beam OmniGraffle drawing" class="ss" src="https://leancrew.com/all-this/images2026/20260220-Simply-supported%20beam%20OmniGraffle%20drawing.png" title="Simply-supported beam OmniGraffle drawing" width="80%"/></p>
<p>Using blue for the leader and dimension lines—and making them thinner—is a good way to distinguish them from forces, and I’ve been doing that for years.<sup id="fnref:blue"><a href="#fn:blue" rel="footnote">1</a></sup> I’ve usually used a different style of arrowhead for the dimensions than for the forces. OmniGraffle has a huge number of arrowhead styles:</p>
<p><img alt="OmniGraffle arrows" class="ss" src="https://leancrew.com/all-this/images2026/20260220-OmniGraffle%20arrows.png" title="OmniGraffle arrows" width="50%"/></p>
<p>I’ve generally used the “Filled Arrow” for forces and the “Sharp Arrow” for dimensions. You might think I’d use the “Dimension Arrow,” but I’ve never liked it. It has a little leader line attached to it, which is, unfortunately, pretty much useless because it’s always the same length. Leader lines are supposed to draw your eye from the object to the dimension line—they have to be different lengths, and they’re usually much longer than the tiny ticks OmniGraffle provides.</p>
<p>I could continue to use the sharp arrows, of course, but I’ve decided my drawings here should look more like the sketches I make in my notebook. And it’s a nice tribute to Prof. Haltiwanger. Although his was my second structural analysis class, it was the one in which I began to truly appreciate the topic.</p>
<p>While I’m at it, I should mention that I made a set of stencils with objects commonly seen in structural analysis drawings.</p>
<p><img alt="Structural stencils for OmniGraffle" class="ss" src="https://leancrew.com/all-this/images2026/20260220-Structural%20stencils%20for%20OmniGraffle.png" title="Structural stencils for OmniGraffle" width="50%"/></p>
<p>The top two rows show fixed, simple, and guided ends; the bottom two rows show springs. There are four variations on simple ends; the differences depend on whether there’s a roller and whether I want to show the hinge explicitly. There’s only one linear spring, but I needed four rotational springs to account for different angles of attachment. All of these can be rotated as needed once they’re placed in an OmniGraffle document.</p>
<div class="footnotes">
<hr/>
<ol>
<li id="fn:blue">
<p>As you can see, I have not been consistent in my use of blue or black for the dimensions themselves. <a href="#fnref:blue" rev="footnote">↩</a></p>
</li>
</ol>
</div>
  ]]>
</content:encoded>
</item>

<item>
<title>Easy to be hard</title>
<link>https://leancrew.com/all-this/2026/02/easy-to-be-hard/</link>
<pubDate>Fri, 20 Feb 2026 00:25:13 +0000</pubDate>
<dc:creator>
  <![CDATA[Dr. Drang]]>
</dc:creator>
<guid>https://leancrew.com/all-this/2026/02/easy-to-be-hard/</guid>
<description>
  <![CDATA[Here’s <a href="https://www.scientificamerican.com/game/math-puzzle-sum-circles/">a geometry puzzle</a> from the March issue of <em>Scientific American</em>. If you see the trick, it’s easy to solve.<sup id="fnref:trick"><a href="#fn:trick" rel="footnote">1</a></sup> After doing it the easy way, I decided to solve it again the hard way, as if I hadn’t noticed the trick.]]>
</description>
<content:encoded>
  <![CDATA[<p>[Equations in this post may not look right (or appear at all) in your RSS reader. Go to <a href="https://leancrew.com/all-this/2026/02/easy-to-be-hard/">the original article</a> to see them rendered properly.]</p>
  <hr />
  <p>Here’s <a href="https://www.scientificamerican.com/game/math-puzzle-sum-circles/">a geometry puzzle</a> from the March issue of <em>Scientific American</em>. If you see the trick, it’s easy to solve.<sup id="fnref:trick"><a href="#fn:trick" rel="footnote">1</a></sup> After doing it the easy way, I decided to solve it again the hard way, as if I hadn’t noticed the trick.</p>
<p>Here’s the puzzle:</p>
<p><img alt="SciAm circle puzzle by Amanda Montañez" class="ss" src="https://leancrew.com/all-this/images2026/20260219-SciAm%20circle%20puzzle%20by%20Amanda%20Montanez.png" title="SciAm circle puzzle by Amanda Montañez" width="100%"/></p>
<blockquote>
<p>A red circle is inscribed inside a blue square. The arrangement leaves gaps in the square’s four corners, two of which are filled with smaller circles that just barely touch the big red circle and the two corner sides of the blue square. This, in turn, leaves two smaller gaps in the corners, which are filled with smaller circles, and so on, with ever smaller circles ad infinitum. The entire diagram is inscribed inside of a 1 × 1 gray square. What is the total circumference of all the circles?</p>
</blockquote>
<p>Without the trick, we’re going to have to work out all the circumferences and add them together. We’ll start by figuring out the relationship between the radii of consecutive circles. Here’s a quarter of the largest circle, the radius of which we’ll call <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>r</mi><mn>0</mn></msub></math>, and the next largest circle, the radius of which we’ll call <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>r</mi><mn>1</mn></msub></math>:</p>
<p><img alt="Radii relationship" class="ss" src="https://leancrew.com/all-this/images2026/20260219-Radii%20relationship.png" title="Radii relationship" width="50%"/></p>
<p>From this drawing, we can express the width in two ways and set them equal to one another:</p>
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><msub><mi>r</mi><mn>0</mn></msub><mo>=</mo><msub><mi>r</mi><mn>1</mn></msub><mo>+</mo><mfrac><msub><mi>r</mi><mn>1</mn></msub><msqrt><mn>2</mn></msqrt></mfrac><mo>+</mo><mfrac><msub><mi>r</mi><mn>0</mn></msub><msqrt><mn>2</mn></msqrt></mfrac></mrow></math>
<p>Multiplying through by <math xmlns="http://www.w3.org/1998/Math/MathML"><msqrt><mn>2</mn></msqrt></math> and rearranging, we get</p>
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><msub><mi>r</mi><mn>1</mn></msub><mo>=</mo><mfrac><mrow><msqrt><mn>2</mn></msqrt><mo>−</mo><mn>1</mn></mrow><mrow><msqrt><mn>2</mn></msqrt><mo>+</mo><mn>1</mn></mrow></mfrac><mspace width="0.167em"></mspace><msub><mi>r</mi><mn>0</mn></msub></mrow></math>
<p>I want to turn this into a fraction with a 1 in the numerator, so I’ll multiply the top and bottom by an expression that will eliminate the square root in the numerator:</p>
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><msub><mi>r</mi><mn>1</mn></msub><mo>=</mo><mfrac><mrow><msqrt><mn>2</mn></msqrt><mo>−</mo><mn>1</mn></mrow><mrow><msqrt><mn>2</mn></msqrt><mo>+</mo><mn>1</mn></mrow></mfrac><mspace width="0.167em"></mspace><mfrac><mrow><msqrt><mn>2</mn></msqrt><mo>+</mo><mn>1</mn></mrow><mrow><msqrt><mn>2</mn></msqrt><mo>+</mo><mn>1</mn></mrow></mfrac><mspace width="0.167em"></mspace><msub><mi>r</mi><mn>0</mn></msub><mo>=</mo><mfrac><mrow><mn>2</mn><mo>−</mo><mn>1</mn></mrow><mrow><mn>2</mn><mo>+</mo><mn>2</mn><msqrt><mn>2</mn></msqrt><mo>+</mo><mn>1</mn></mrow></mfrac><mspace width="0.167em"></mspace><msub><mi>r</mi><mn>0</mn></msub><mo>=</mo><mfrac><mn>1</mn><mrow><mn>3</mn><mo>+</mo><mn>2</mn><msqrt><mn>2</mn></msqrt></mrow></mfrac><mspace width="0.167em"></mspace><msub><mi>r</mi><mn>0</mn></msub></mrow></math>
<p>This relationship also holds for any two consecutive circles,</p>
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><msub><mi>r</mi><mi>i</mi></msub><mo>=</mo><mfrac><mn>1</mn><mrow><mn>3</mn><mo>+</mo><mn>2</mn><msqrt><mn>2</mn></msqrt></mrow></mfrac><mspace width="0.167em"></mspace><msub><mi>r</mi><mrow><mi>i</mi><mo>−</mo><mn>1</mn></mrow></msub></mrow></math>
<p>which means we can express the radius of the <em>i</em>th circle in terms of the radius of the largest circle:</p>
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><msub><mi>r</mi><mi>i</mi></msub><mo>=</mo><mfrac><mn>1</mn><msup><mrow><mo form="prefix" stretchy="true">(</mo><mn>3</mn><mo>+</mo><mn>2</mn><msqrt><mn>2</mn></msqrt><mo form="postfix" stretchy="true">)</mo></mrow><mi>i</mi></msup></mfrac><mspace width="0.25em"></mspace><msub><mi>r</mi><mn>0</mn></msub></mrow></math>
<p>So the sum of all the circumferences is <math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mn>2</mn><mi>π</mi></mrow></math> times the sum of all the radii:</p>
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mn>2</mn><mi>π</mi><mrow><mo form="prefix" stretchy="true">[</mo><msub><mi>r</mi><mn>0</mn></msub><mo>+</mo><mn>2</mn><munderover><mo>∑</mo><mrow><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mo accent="false">∞</mo></munderover><mspace width="0.278em"></mspace><mfrac><mn>1</mn><msup><mrow><mo form="prefix" stretchy="true">(</mo><mn>3</mn><mo>+</mo><mn>2</mn><msqrt><mn>2</mn></msqrt><mo form="postfix" stretchy="true">)</mo></mrow><mi>i</mi></msup></mfrac><mspace width="0.167em"></mspace><msub><mi>r</mi><mn>0</mn></msub><mo form="postfix" stretchy="true">]</mo></mrow><mo>=</mo><mn>2</mn><mi>π</mi><mspace width="0.167em"></mspace><msub><mi>r</mi><mn>0</mn></msub><mspace width="0.278em"></mspace><mrow><mo form="prefix" stretchy="true">[</mo><mn>1</mn><mo>+</mo><mn>2</mn><munderover><mo>∑</mo><mrow><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mo accent="false">∞</mo></munderover><mspace width="0.278em"></mspace><mfrac><mn>1</mn><msup><mrow><mo form="prefix" stretchy="true">(</mo><mn>3</mn><mo>+</mo><mn>2</mn><msqrt><mn>2</mn></msqrt><mo form="postfix" stretchy="true">)</mo></mrow><mi>i</mi></msup></mfrac><mo form="postfix" stretchy="true">]</mo></mrow></mrow></math>
<p>Note that there’s only one circle with radius <math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>r</mi><mn>0</mn></msub></math>, but two circles for all the other radii.</p>
<p>By the way, this expression is where it’s helpful to have the fraction inside the sum written with a 1 in the numerator. We know that</p>
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><munderover><mo>∑</mo><mrow><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mo accent="false">∞</mo></munderover><mspace width="0.278em"></mspace><mfrac><mn>1</mn><msup><mn>2</mn><mi>i</mi></msup></mfrac></mrow></math>
<p>converges, so our fraction, which has a larger denominator, must also converge.</p>
<p>We’re nearly there. Recall that the gray square (the one that’s rotated 45°) has a side length of 1. That means</p>
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><msub><mi>r</mi><mn>0</mn></msub><mo>=</mo><mfrac><mn>1</mn><mrow><mn>2</mn><msqrt><mn>2</mn></msqrt></mrow></mfrac></mrow></math>
<p>so the sum of the circumferences is</p>
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mfrac><mi>π</mi><msqrt><mn>2</mn></msqrt></mfrac><mspace width="0.278em"></mspace><mrow><mo form="prefix" stretchy="true">[</mo><mn>1</mn><mo>+</mo><mn>2</mn><munderover><mo>∑</mo><mrow><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mo accent="false">∞</mo></munderover><mspace width="0.278em"></mspace><mfrac><mn>1</mn><msup><mrow><mo form="prefix" stretchy="true">(</mo><mn>3</mn><mo>+</mo><mn>2</mn><msqrt><mn>2</mn></msqrt><mo form="postfix" stretchy="true">)</mo></mrow><mi>i</mi></msup></mfrac><mo form="postfix" stretchy="true">]</mo></mrow></mrow></math>
<p>Now for a confession: I have always stunk at working out infinite series. Luckily, I can now lean on a computational cane. Here’s a Mathematica expression that will return the infinite sum:</p>
<pre><code>Pi/Sqrt[2] (1 + 2 Sum[1/(3 + 2 Sqrt[2])^i, {i, 1, Infinity}])
</code></pre>
<p>The answer, as we know from doing it the easy way, is <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>π</mi></math>.</p>
<p>If I didn’t have Mathematica, I’d probably set up a finite series for the expression without <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>π</mi></math>,</p>
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mfrac><mn>1</mn><msqrt><mn>2</mn></msqrt></mfrac><mspace width="0.278em"></mspace><mrow><mo form="prefix" stretchy="true">[</mo><mn>1</mn><mo>+</mo><mn>2</mn><munderover><mo>∑</mo><mrow><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mi>n</mi></munderover><mspace width="0.278em"></mspace><mfrac><mn>1</mn><msup><mrow><mo form="prefix" stretchy="true">(</mo><mn>3</mn><mo>+</mo><mn>2</mn><msqrt><mn>2</mn></msqrt><mo form="postfix" stretchy="true">)</mo></mrow><mi>i</mi></msup></mfrac><mo form="postfix" stretchy="true">]</mo></mrow></mrow></math>
<p>and run out the calculations for different values of <em>n</em> to see where it converges. We can show the results as a table,</p>
<table>
<thead>
<tr>
<th align="center">n</th>
<th align="center">Sum</th>
</tr>
</thead>
<tbody>
<tr>
<td align="center">1</td>
<td align="center">0.94974747</td>
</tr>
<tr>
<td align="center">2</td>
<td align="center">0.99137803</td>
</tr>
<tr>
<td align="center">3</td>
<td align="center">0.99852070</td>
</tr>
<tr>
<td align="center">4</td>
<td align="center">0.99974619</td>
</tr>
<tr>
<td align="center">5</td>
<td align="center">0.99995645</td>
</tr>
<tr>
<td align="center">6</td>
<td align="center">0.99999253</td>
</tr>
<tr>
<td align="center">7</td>
<td align="center">0.99999872</td>
</tr>
<tr>
<td align="center">8</td>
<td align="center">0.99999978</td>
</tr>
<tr>
<td align="center">9</td>
<td align="center">0.99999996</td>
</tr>
<tr>
<td align="center">10</td>
<td align="center">0.99999999</td>
</tr>
</tbody>
</table>
<p>or as a plot,</p>
<p><img alt="Convergence plot" class="ss" src="https://leancrew.com/all-this/images2026/20260219-Convergence%20plot.png" title="Convergence plot" width="80%"/></p>
<p>Either way, going out ten terms is overkill—it’s obvious that the sum is converging to 1, which means the circumference sum is converging to <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>π</mi></math>. You can, I guess, consider this numerical exercise as a check on Mathematica’s work. Or a check on the easy solution.</p>
<div class="footnotes">
<hr/>
<ol>
<li id="fn:trick">
<p>SciAm also uses the trick in its solution, which you <em>won’t</em> see if you click on the link in this paragraph. It’s one link further away. <a href="#fnref:trick" rev="footnote">↩</a></p>
</li>
</ol>
</div>
  ]]>
</content:encoded>
</item>

</channel>
</rss>

