tag:blogger.com,1999:blog-57740560325699740112024-02-02T13:51:13.548-08:00First Sunday Doomsday AlgorithmA method for finding the day of the week for any date -- in your head.Bob Goddardhttp://www.blogger.com/profile/03308815202377527967noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-5774056032569974011.post-27212498605214259772022-10-11T18:46:00.000-07:002022-10-11T18:46:17.900-07:00Full-year Perpetual Cup<p>Here's a full-year perpetual calendar cup. Just one moving part, and you adjust it just once a year. All the months end properly at 30 or 31 days (except February). You can really plan ahead with this device!</p><p><br /></p><p>Watch the video!<br /></p><div class="separator" style="clear: both; text-align: center;"><iframe allowfullscreen="" class="BLOG_video_class" height="273" src="https://www.youtube.com/embed/x86zUW_MDAM" width="480" youtube-src-id="x86zUW_MDAM"></iframe></div><p></p>Bob Goddardhttp://www.blogger.com/profile/03308815202377527967noreply@blogger.comtag:blogger.com,1999:blog-5774056032569974011.post-69701517632839666802021-09-15T17:08:00.006-07:002021-09-19T13:21:44.076-07:00Calendar Cup<div class="separator" style="clear: both; text-align: center;"><br /></div>Here is a 200-year calendar in the form of a handy pencil cup. I made it from PVC pipe, with laser-printed "sticker paper", and laser-printed plastic "waterproof paper" for the rotating sleeve. To lock in the setting, the floor of the cup is held, by a wing nut, to the inverted "floor" of a small base cup, which is glued to the sleeve. These floor disks are 3mm acrylic, laser-cut to match the pipe diameter.<p></p><p>Features of the cup:</p><ul style="text-align: left;"><li>Displays any month 1900 - 2099</li><li>Displays month name</li><li>Holds setting even when bumped or handled</li><li>Unambiguous instructions (align year with month)</li><li>Easy to find year: 00-99 in ascending order</li><li>Easy to find month: 12 red months in window</li><li>Rotation limited to valid angles</li><li>It's a useful desktop accessory!<br /></li></ul><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEZZENt5r6_RbJjCzLntF3e6dPHffd404Jpt9xpWyfhyZfpdQqubYhyphenhyphenw1EHgFy35xXEvtNRbY77ncXW6BoogBzhCBvLNV6iI8uKuNTU5LK_AXiWIb15FmVXlCbNJOgn3gt3dMp9TPjMGw/s2048/IMG_1282.jpeg" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" data-original-height="2048" data-original-width="1536" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEZZENt5r6_RbJjCzLntF3e6dPHffd404Jpt9xpWyfhyZfpdQqubYhyphenhyphenw1EHgFy35xXEvtNRbY77ncXW6BoogBzhCBvLNV6iI8uKuNTU5LK_AXiWIb15FmVXlCbNJOgn3gt3dMp9TPjMGw/w300-h400/IMG_1282.jpeg" width="300" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqSdDxKi50OEO4qrCszVl3GZBPYWMcfcs9gpRnWoaL98bUyQ3pOF6pPIGefMv8OrHLVO1deIcYfGLt6BFEJ55Q9ezhyi51-4LKuSaNFbrO6nGOIKvKS_c44YcIhg_HPJcAR0ZqeDa82ec/s2048/IMG_1283.jpeg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="2048" data-original-width="1536" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqSdDxKi50OEO4qrCszVl3GZBPYWMcfcs9gpRnWoaL98bUyQ3pOF6pPIGefMv8OrHLVO1deIcYfGLt6BFEJ55Q9ezhyi51-4LKuSaNFbrO6nGOIKvKS_c44YcIhg_HPJcAR0ZqeDa82ec/w300-h400/IMG_1283.jpeg" width="300" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTQPjvqZYk6yGiZYClTK55mptHQ5VA2SbjjhTRPMca9KBCZRlPtQSGDXnwZSizn8LOO4zJn4pOBCq8xk4BAlJZE7OUVX7TVQrCO6yQlyetyECCM12EqhhrPEfkq2-oid4mmGC2Z3GpeMY/s2048/IMG_1284.jpeg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="2048" data-original-width="1536" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTQPjvqZYk6yGiZYClTK55mptHQ5VA2SbjjhTRPMca9KBCZRlPtQSGDXnwZSizn8LOO4zJn4pOBCq8xk4BAlJZE7OUVX7TVQrCO6yQlyetyECCM12EqhhrPEfkq2-oid4mmGC2Z3GpeMY/w300-h400/IMG_1284.jpeg" width="300" /></a><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8GGjTVPiG5Pk7iFMVO4hDVy9Zbx-CEcCrFs7-e4DYsyIvLqXxZZzBxCAjnLyRBKx8Te6krQ1HEQZZ-mhDPnDri_2neudjtcgm5KjkOY8jScayiDCPdAQgvSRhDkmm7XKHeHQCxDWUZak/s2048/IMG_1285.jpeg" style="clear: right; margin-bottom: 1em; margin-left: 1em; text-align: center;"><img border="0" data-original-height="2048" data-original-width="1536" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8GGjTVPiG5Pk7iFMVO4hDVy9Zbx-CEcCrFs7-e4DYsyIvLqXxZZzBxCAjnLyRBKx8Te6krQ1HEQZZ-mhDPnDri_2neudjtcgm5KjkOY8jScayiDCPdAQgvSRhDkmm7XKHeHQCxDWUZak/w300-h400/IMG_1285.jpeg" width="300" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDb3tRQianZpRQmkq8EpO_tseJsVHvo11PbwzmfjK2zuoCnFLHX40sWzhnq_1-G1nyHXZEltqAH1FJLEztcVdyBgD-IdqkwD5TYVe1A8i_7Naszypb13dYIGIefUKbjl_21GEyn1mZBJE/s2048/IMG_1286.jpeg" style="clear: left; margin-bottom: 1em; margin-left: 1em; text-align: center;"><img border="0" data-original-height="2048" data-original-width="1536" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDb3tRQianZpRQmkq8EpO_tseJsVHvo11PbwzmfjK2zuoCnFLHX40sWzhnq_1-G1nyHXZEltqAH1FJLEztcVdyBgD-IdqkwD5TYVe1A8i_7Naszypb13dYIGIefUKbjl_21GEyn1mZBJE/w300-h400/IMG_1286.jpeg" width="300" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3MHxAfzy_f941sR6FpJSNKS6ANkrmujXxMINOnQ8Xjns9FJwkBRYHTR8LIpUOBd5Ph1r-A8AzA62jx38W532K2q10n5opdo3zvWrLY0xPPd9lLvbi85gRIr4yZpQuDLo7sgC_9i4OeN8/s2048/IMG_1272.jpeg" style="clear: right; margin-bottom: 1em; margin-left: 1em; text-align: center;"><img border="0" data-original-height="2048" data-original-width="2048" height="293" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3MHxAfzy_f941sR6FpJSNKS6ANkrmujXxMINOnQ8Xjns9FJwkBRYHTR8LIpUOBd5Ph1r-A8AzA62jx38W532K2q10n5opdo3zvWrLY0xPPd9lLvbi85gRIr4yZpQuDLo7sgC_9i4OeN8/w293-h293/IMG_1272.jpeg" width="293" /><br /></a><br /><p></p><p><br /></p>Bob Goddardhttp://www.blogger.com/profile/03308815202377527967noreply@blogger.comtag:blogger.com,1999:blog-5774056032569974011.post-75356625240900973692018-05-03T08:46:00.000-07:002020-07-20T14:55:05.686-07:00New Perpetual CalendarI set myself a goal: to make the simplest device that can find the day of the week for any date. I think you'll agree that a device made from a single sheet of paper is as simple as you can get.<br />
<br />
Here is my <a href="https://drive.google.com/file/d/1KnuzlpBQhwyr107qI1XbLNQeLsES3VGC/view?usp=sharing" target="_blank">Perpetual Calendar</a> (click to view the PDF file). With just one moving part -- a sliding window you cut off the sheet itself -- it displays a month's calendar for <b>any date</b> in the Gregorian calendar.<br />
<br />
All you need is scissors and access to a printer. It will only cost you one sheet of paper. No mental algorithm required! The expiration date for this device is: never!<br />
<br />
Here is a <a href="https://drive.google.com/file/d/1XGtb-KV3tkA0_HXqINqibB4C_gIq7s-H/view?usp=sharing" target="_blank">non-USA version</a> (still in English), which fits A4 paper, and starts the week on Monday instead of Sunday.<br />
<br />
<br />
Here is an earlier design, the <a href="https://drive.google.com/open?id=1zsqlwXjxPw-_ks23Js2kPsJhporsnkL6" target="_blank">One-page 200-year calendar</a>. Also a single sheet of paper, it is limited to the years 1900 - 2099. It folds neatly in thirds, like a letter.<br />
<br />Bob Goddardhttp://www.blogger.com/profile/03308815202377527967noreply@blogger.comtag:blogger.com,1999:blog-5774056032569974011.post-21503414615741416902011-01-27T15:52:00.001-08:002020-07-14T19:51:18.623-07:00Learn by Example[Revised 7/29/2011] <br />
This quick summary will show you, by example, how to determine the day of the week for any date -- in your head! (See the longer post for the full story.)<br />
<br />
<a name='more'></a>The given date is broken into four numbers, <strong>mm/dd/ccyy.</strong> The four steps of the algorithm will each use one of these four numbers. The math is easy – we accumulate a running total we’ll call T. At the end, we’ll have a number in the range 0-6, representing the day of the week. <br />
<h4>
<span style="font-size: 130%;">Summary of the First Sunday Doomsday Algorithm for the date <strong>mm/dd/ccyy</strong></span></h4>
<table border="2" cellpadding="2" cellspacing="0" style="width: 971px;"><tbody>
<tr> <td valign="top" width="32"><strong>Step</strong></td> <td valign="top" width="144"><strong>Description</strong></td> <td valign="top" width="185"><strong>Description <br />for nerds</strong></td> <td valign="top" width="606"><strong>Conversion Tables and Memory Aids</strong></td> </tr>
<tr> <td valign="top" width="32">1.</td> <td valign="top" width="144">Start with yy. <br />
If odd, add 11. <br />
Then cut in half. <br />
If odd, add 11.</td> <td valign="top" width="185">T = <strong>yy </strong>(if T is odd) T = T + 11 <br />
T = T / 2 <br />
(if T is odd) T = T + 11</td> <td valign="top" width="606"><br />
“<strong>Odd plus 11</strong>.” <br />
<br />
“<strong>Odd plus 11</strong>.” Again.</td> </tr>
<tr> <td valign="top" width="32">2.</td> <td valign="top" width="144">Add the century’s value.</td> <td valign="top" width="185">T = T + CFS[<strong>cc</strong>] <br />
from table <br />
<br />
<span style="font-size: 78%;">(Result is YFS)</span></td> <td valign="top" width="606"><table border="1" cellpadding="2" cellspacing="0" style="width: 569px;"><tbody>
<tr> <td align="center" valign="top" width="61">1700s</td> <td align="center" valign="top" width="70">1800s</td> <td align="center" valign="top" width="76">1900s</td> <td align="center" valign="top" width="67">2000s</td> <td valign="top" width="293">Covers American history</td> </tr>
<tr> <td align="center" valign="top" width="61">0</td> <td align="center" valign="top" width="70">2</td> <td align="center" valign="top" width="76">4</td> <td align="center" valign="top" width="67">5</td> <td valign="top" width="293">(Remember<strong> “No tuna for Friday.”</strong>)</td> </tr>
</tbody></table>
(For years prior to the Gregorian correction, use CFS = <strong>cc</strong>.)</td> </tr>
<tr> <td valign="top" width="32">3.</td> <td valign="top" width="144">Add the month’s doomsday. </td> <td valign="top" width="185">T = T + MD[<strong>mm</strong>] <br />
from table <br />
<br />
<br />
<br />
<br />
<br />
<span style="font-size: 78%;">(Result is MFS)</span></td> <td valign="top" width="606"><table border="0" cellpadding="2" cellspacing="0" style="width: 551px;"><tbody>
<tr> <td valign="top" width="136">Even month (except 2):</td> <td valign="top" width="413">Use the month number.</td> </tr>
<tr> <td valign="top" width="136">Odd month (except 1 or 3):</td> <td valign="top" width="413">Switch according to <strong>“Work 9 to 5 at 7-eleven.”</strong> </td> </tr>
<tr> <td valign="top" width="136">January:</td> <td valign="top" width="413">Use 3, <strong>three</strong> years out of four, but use 4 for leap years. </td> </tr>
<tr> <td valign="top" width="136">February:</td> <td valign="top" width="413">Use zero, but use 1 for leap years. It’s a binary switch. </td> </tr>
<tr> <td valign="top" width="136">March:</td> <td valign="top" width="413">Use zero. March is the easiest month.</td> </tr>
</tbody></table>
</td> </tr>
<tr> <td valign="top" width="32">4.</td> <td valign="top" width="144">Subtract total from <strong>dd.</strong></td> <td valign="top" width="185">Day = <strong>dd</strong> – T</td> <td valign="top" width="606"><table border="1" cellpadding="2" cellspacing="0" style="width: 596px;"><tbody>
<tr> <td valign="top" width="81">0=Sunday</td> <td valign="top" width="84">1=Monday</td> <td valign="top" width="88">2=Tuesday</td> <td valign="top" width="63">3=Wed.</td> <td valign="top" width="96">4=Thursday</td> <td valign="top" width="74">5=Friday</td> <td valign="top" width="108">6=Saturday</td> </tr>
<tr> <td valign="top" width="81">None-day</td> <td valign="top" width="84">One-day</td> <td valign="top" width="88">Twos-day</td> <td valign="top" width="63">3 = “w”</td> <td valign="top" width="96">Fours-day</td> <td valign="top" width="74">Five-day</td> <td valign="top" width="108">Six-urday</td> </tr>
</tbody></table>
</td> </tr>
</tbody></table>
<h2>
Examples</h2>
What day was July 4, 1776 (U.S. independence day)? <br />
<table border="0" cellpadding="2" cellspacing="0" style="width: 898px;"><tbody>
<tr> <td valign="top" width="19">1.</td> <td valign="top" width="186">76 / 2 = 38 <br />
38; 3</td> <td valign="top" width="691"><strong>yy</strong> is even, add nothing, just cut in half. <br />
<strong>T</strong> is even, nothing to add. Then subtract sevens (38-35=3).</td> </tr>
<tr> <td valign="top" width="29">2.</td> <td valign="top" width="186">+ 0 = 3</td> <td valign="top" width="691">First entry in the century table (<strong>cc</strong>=17, first century in American history), so use the first word of “<strong>No</strong> tuna for Friday”. “No” stands for zero.</td> </tr>
<tr> <td valign="top" width="33">3.</td> <td valign="top" width="186">+ 11 = 14; 0</td> <td valign="top" width="691">The month (<strong>mm</strong>=7) gets switched to 11 according to the phrase “Work ... at 7-eleven”. Then remove a pair of sevens.</td> </tr>
<tr> <td valign="top" width="37">4.</td> <td valign="top" width="186">4 - 0 = 4. Thursday</td> <td valign="top" width="691"><strong>dd</strong>=4. Result 4 = “Fours-day”.</td> </tr>
</tbody></table>
OK, that example was presented very concisely, and you’ll need some explanation. In step 1, we started with the two-digit year, 76. Because it’s even, we skipped the “add 11” instruction. After dividing by 2, we checked the result for oddness, and we skipped the second “add 11” instruction. That’s it for step 1, but there’s some simplification to do. <br />
<br />
As you know, adding (or subtracting) 7 to a date leaves the day of the week unchanged. At the end of each of our four steps, you can (optionally) subtract 7 (or 14, etc.) from the running total T. In the example, the notation “38; 3” means that we removed excess sevens from the total of 38, leaving a simplified total of 3.<br />
In step 2, we add a value based on the centurial number. For each century, there is a value you need to remember, as shown in the summary chart. This little table is very easy to recall if you remember the nonsense phrase “No tuna for Friday”. The phrase gives you the four values (0, 2, 4, 5), corresponding to the four centuries in American history. In the example just shown, you only needed to recite the first word of the phrase, “No…”, to realize we need to add nothing to our running total for our year in the 1700s. <br />
<br />
In step 3, we add a value based on the month number. Once again, there’s a table shown in the summary chart, and another nonsense phrase to remember. In this example, the 7 (July’s month number) gets swapped with the value 11, which we add to our running total: 3+11=14. Removing excess sevens at the end of the step, we can call our total zero. (Month 11 would get the value 7. Months 9 and 5 get swapped the same way.) <br />
<br />
In step 4, following the instructions in the chart, we subtract our total T from the date, resulting in 4. This value corresponds to Thursday, using the table in the chart. You’ll memorize this table quickly, thanks to the “nonsense words” combining day names with the numbers 0-6. <br />
<br />
The first example had lots of zeros or “do nothing” steps. The next example won’t have all those lucky breaks. It will also address the problem that occurs when the subtraction in step 4 gives a negative result <br />
<br />
What day was May 1, 1895? <br />
<table border="0" cellpadding="2" cellspacing="0" style="width: 907px;"><tbody>
<tr> <td valign="top" width="19">1.</td> <td valign="top" width="187">95 + 11 = 106 <br />
/ 2 = 53 <br />
+ 11 = 64; 1</td> <td valign="top" width="699"><strong>yy</strong> is odd, so add 11. <br />
Cut in half. <br />
<strong>T</strong> is odd, so add 11. Remove excess sevens (64-63=1).</td> </tr>
<tr> <td valign="top" width="28">2.</td> <td valign="top" width="187">+ 2 = 3</td> <td valign="top" width="699">Recall the century table, “1700s, 1800s”. For <strong>cc</strong>=18, use the second word of “No <strong>tuna</strong> for Friday”. “Tuna” stands for 2.</td> </tr>
<tr> <td valign="top" width="32">3.</td> <td valign="top" width="187">+ 9 = 12; 5</td> <td valign="top" width="699">The month (<strong>mm</strong>=5) gets switched to 9 according to “Work 9 to 5...” . Then remove an excess seven.</td> </tr>
<tr> <td valign="top" width="36">4.</td> <td valign="top" width="187">1 – 5 = -4?? <br />
7 – (5-1) = 3. Wednesday</td> <td valign="top" width="699">Darn, that’s going to be negative, so… <br />
Go ahead and find the negative value, then take the sevens complement. Result is 3, “Wednesday”.</td> </tr>
</tbody></table>
The “sevens complement” is a fancy name for the way we “negate” a negative number: just subtract the value from seven. <br />
<br />
August 4, 1962 <br />
<table border="0" cellpadding="2" cellspacing="0" style="width: 907px;"><tbody>
<tr> <td valign="top" width="39">1.</td> <td valign="top" width="188">62 / 2 = 31 <br />
+ 11 = 42; 0</td> <td valign="top" width="683"><strong>yy</strong> is even, just cut in half. <br />
<strong>T</strong> is odd, so add 11. Remove excess sevens.</td> </tr>
<tr> <td valign="top" width="39">2.</td> <td valign="top" width="188">+ 4 = 4</td> <td valign="top" width="683">Add 4 for the 1900s. (“No tuna <strong>for</strong> Friday”.</td> </tr>
<tr> <td valign="top" width="39">3.</td> <td valign="top" width="188">+ 8 = 12; 5</td> <td valign="top" width="683">Even month; use the month number. Remove a seven.</td> </tr>
<tr> <td valign="top" width="39">4.</td> <td valign="top" width="188">4 – 5 = –1?? <br />
7-1 = 6. Saturday</td> <td valign="top" width="683">Figure the negative result, <br />
then complement to get 6, “Six-urday”.</td> </tr>
</tbody></table>
<br />
December 7, 1941 (Pearl Harbor day) <br />
<table border="0" cellpadding="2" cellspacing="0" style="width: 907px;"><tbody>
<tr> <td valign="top" width="39">1.</td> <td valign="top" width="188">41 + 11 = 52 <br />
/ 2 = 26 <br />
26</td> <td valign="top" width="683"><strong>yy</strong> is odd, so add 11. <br />
Cut in half. <br />
<strong>T</strong> is even, nothing to add.</td> </tr>
<tr> <td valign="top" width="39">2.</td> <td valign="top" width="188">+ 4 = 30; 2</td> <td valign="top" width="683">Add 4 for the 1900s. Remove sevens.</td> </tr>
<tr> <td valign="top" width="39">3.</td> <td valign="top" width="188">+ 12 = 14; 0</td> <td valign="top" width="683">Even month; use the month number. Remove sevens.</td> </tr>
<tr> <td valign="top" width="39">4.</td> <td valign="top" width="188">7 – 0 = 7; 0. Sunday</td> <td valign="top" width="683">None-day.</td> </tr>
</tbody></table>
<br />
December 31, 1899 <br />
<table border="0" cellpadding="2" cellspacing="0" style="width: 907px;"><tbody>
<tr> <td valign="top" width="39">1.</td> <td valign="top" width="188">99 + 11 = 110 <br />
/ 2 = 55 <br />
+ 11 = 66; 3</td> <td valign="top" width="683"><strong>yy</strong> is odd, so add 11. <br />
Cut in half. <br />
<strong>T</strong> is odd, so add 11. Remove excess sevens.</td> </tr>
<tr> <td valign="top" width="39">2.</td> <td valign="top" width="188">+ 2 = 5</td> <td valign="top" width="683">Add 2 for the 1800s.</td> </tr>
<tr> <td valign="top" width="39">3.</td> <td valign="top" width="188">+ 12 = 17; 3</td> <td valign="top" width="683">Even month; use the month number. Remove sevens.</td> </tr>
<tr> <td valign="top" width="39">4.</td> <td valign="top" width="188">31 – 3 = 28; 0. Sunday</td> <td valign="top" width="683">None-day.</td> </tr>
</tbody></table>
<br />
January 1, 1900 (The next day, to test the previous example’s answer) <br />
<table border="0" cellpadding="2" cellspacing="0" style="width: 907px;"><tbody>
<tr> <td valign="top" width="39">1.</td> <td valign="top" width="188">0 / 2 = 0 <br />
0</td> <td valign="top" width="683">Even, so just divide by 2. <br />
<strong>T</strong> is even, nothing to add.</td> </tr>
<tr> <td valign="top" width="39">2.</td> <td valign="top" width="188">+ 4 = 4</td> <td valign="top" width="683">Add 4 for the 1900s.</td> </tr>
<tr> <td valign="top" width="39">3.</td> <td valign="top" width="188">+ 3 = 7; 0</td> <td valign="top" width="683">1900 was not a leap year, so this January's doomsday is 3, not 4!</td> </tr>
<tr> <td valign="top" width="39">4.</td> <td valign="top" width="188">1 – 0 = 1. Monday</td> <td valign="top" width="683">One-day.</td> </tr>
</tbody></table>
<h2>
</h2>
<br />
Here’s the best part of the First Sunday Doomsday Algorithm: If you remember the result of step 2 (called the year’s first Sunday), you can use it throughout the current year, starting the algorithm with step 3. If you remember the result of step 3 (called the month’s first Sunday), you can use it throughout the current month, performing only step 4. To remind yourself of this month’s first Sunday, whenever you look at a calendar, repeat to yourself the date at the top of the Sunday column.<br />
The older post below gives a longer explanation of the algorithm.Bob Goddardhttp://www.blogger.com/profile/03308815202377527967noreply@blogger.comtag:blogger.com,1999:blog-5774056032569974011.post-45304146328556946142009-12-02T13:00:00.002-08:002023-01-23T14:01:56.767-08:00Learn the First Sunday Doomsday Algorithm[Revised 1/23/2023] <br />This longer article will show you how to determine the day of the week for any given date -- without consulting a calendar. It covers some history (of calendars and methods) and explains how this method works, and why it works. <br /> <br /> <a name='more'></a> <p>If you’re like most people, you can’t imagine how you might figure out the days of some month in the past or future. If you were asked about a date in the current month, you could probably figure that out, using multiples of seven and a bit of finger counting. Some people are really good at this, and some can mentally picture the whole month’s calendar – a skill <em>not</em> required to learn this method. </p> <p>People have struggled to compute days of the week ever since Julius Caesar decreed the modern calendar in 46 B.C. (and Pope Gregory finalized the leap year rules in 1582). Finally in 1882, Christian Zeller of Germany published <a href="http://en.wikipedia.org/wiki/Zeller%27s_congruence">a formula</a>, which remains probably the best method for computer programs. </p> <p>But can it be done mentally, by an average person? Yes! Charles Dodgson (using his famous pen name, Lewis Carroll) published a method in 1887, which mathematician John Horton Conway enhanced in a 1973 journal article (naming it the Doomsday algorithm), and a 1982 book. Since 1994 (the year of the first practical web browser), Rudy Limeback has provided <a href="http://rudy.ca/doomsday.html">a web site</a> with an excellent explanation of Conway’s algorithm. Mike Walters suggested an improvement in 2008, in his <a href="http://easydoomsday.blogspot.com/">blog</a>, and enhanced it in 2010 in a <a href="http://arxiv.org/ftp/arxiv/papers/1010/1010.0765.pdf">paper</a> with Chamberlain Fong. The First Sunday doomsday algorithm is built on these foundations. </p> <p>The algorithm is a four-step process of simple mental arithmetic. A few memorable phrases will remind you of the four steps. The entire process is summarized in a handy reference chart, in the Summary section below. Some paragraphs, labeled “tech note”, give background material and history, not needed if you just want to use the method.</p> <p><em>The big advantage of this method is that you can skip two, or three, of the four steps, when working with the current year, or month</em>. Thus First Sunday doomsday algorithm is useful for real-life, near-term date questions, as well as the “parlor trick” of quickly naming the day of distant dates. The method works for dates all the way back to the year 1 AD. <br /></p> <h2>How difficult is it?</h2> <p>The method presented here has been fine-tuned to use just one subtraction, and just one trivial division (of an even number by 2). The rest is addition – on average just three of them -- of small numbers. There is no “memory space” required to hold intermediate results; you just accumulate a running total. There will be, of course, inevitably some adding or subtracting of sevens in any calendar work. </p> <p>The logical way to figure the day of the week, would be to count the days elapsed from some “zero day”, then divide by seven. The remainder would be your answer. In doing this count, you would have to account for all the rules of month lengths ("30 days hath September, ...") and leap years ("Years divisible by 4 are leap years; except those divisible by 100 aren’t; except those divisible by 400 are"). Remarkably, the First Sunday doomsday algorithm does the job with no multiplying, and no dividing anything by 4, or by 7. </p> <p>Is it worth the trouble to learn the algorithm? After all, you don’t really need to find the days of historic dates. But how often do you wonder about the 15th of next month, or upcoming holidays, or the final exam schedule? Do you say “who knows, I don’t have a calendar in front of me”? Learning the algorithm will pay off for the rest of your life. And our calendar system is not going to be replaced by a more rational “star-date metric system” anytime soon. <br /></p> <p>Why didn’t the Romans come up with a formula for finding the day of the week? Because it’s difficult to calculate <em>anything</em> using Roman numerals! The Hindu-Arabic numeral system (with its handy zero) was introduced to Europe a thousand years after the Julian calendar. After another thousand years, Lewis Carroll approached the problem, followed by Dr. Conway 86 years later. Ideas spread more slowly before the internet. <br /></p> <p>[Tech note: The measure of difficulty for a method like this includes several factors: remembering intermediate variables; the number of operations, and the size of the numbers involved; and the problem of remembering the steps of the method itself, along with its numbers or “reminder phrases” for conversions. I believe this (averaged) count of arithmetic operations is the lowest achievable: 3 add, 1 subtract, 1 divide (even number by 2). Please email me if you find an improvement.]</p> <p>Let’s get started with how the algorithm got its name.</p> <h2>What’s a First Sunday?</h2> <p>Here is typical calendar page, so we can talk about days of a particular month. Looking at this example, you can see the month’s first Sunday is the third. Let’s abbreviate this: MFS = 3. </p> <p>Here’s the payoff for knowing the MFS: the day of the week is found by subtracting MFS from the date in question, and referring to the nearby table. This table simply associates numbers with the days of the week; a day’s number tells you “how many days past Sunday”. <br /></p> <table border="0" cellpadding="2" cellspacing="32" style="width: 716px;"><tbody> <tr> <td valign="top" width="250"> <table border="0" cellpadding="2" cellspacing="0" style="width: 235px;"><tbody> <tr> <td align="right" valign="top" width="31">Su</td> <td align="right" valign="top" width="36">Mo</td> <td align="right" valign="top" width="33">Tu</td> <td align="right" valign="top" width="36">We</td> <td align="right" valign="top" width="33">Th</td> <td align="right" valign="top" width="32">Fr</td> <td align="right" valign="top" width="32">Sa</td> </tr> <tr> <td align="right" valign="top" width="31"> </td> <td align="right" valign="top" width="36"> </td> <td align="right" valign="top" width="33"> </td> <td align="right" valign="top" width="36"> </td> <td align="right" valign="top" width="33"> </td> <td align="right" valign="top" width="32">1</td> <td align="right" valign="top" width="32">2</td> </tr> <tr> <td align="right" valign="top" width="31"><strong><span style="background-color: yellow;">3</span></strong></td> <td align="right" valign="top" width="36">4</td> <td align="right" valign="top" width="33">5</td> <td align="right" valign="top" width="36">6</td> <td align="right" valign="top" width="33">7</td> <td align="right" valign="top" width="32">8</td> <td align="right" valign="top" width="32">9</td> </tr> <tr> <td align="right" valign="top" width="31">10</td> <td align="right" valign="top" width="36">11</td> <td align="right" valign="top" width="33">12</td> <td align="right" valign="top" width="36">13</td> <td align="right" valign="top" width="33">14</td> <td align="right" valign="top" width="32">15</td> <td align="right" valign="top" width="32">16</td> </tr> <tr> <td align="right" valign="top" width="31">17</td> <td align="right" valign="top" width="36">18</td> <td align="right" valign="top" width="33">19</td> <td align="right" valign="top" width="36">20</td> <td align="right" valign="top" width="33">21</td> <td align="right" valign="top" width="32">22</td> <td align="right" valign="top" width="32">23</td> </tr> <tr> <td align="right" valign="top" width="31">24</td> <td align="right" valign="top" width="36">25</td> <td align="right" valign="top" width="33">26</td> <td align="right" valign="top" width="36">27</td> <td align="right" valign="top" width="33">28</td> <td align="right" valign="top" width="32">29</td> <td align="right" valign="top" width="32">30</td> </tr> </tbody></table> </td> <td valign="top" width="368"> <table border="1" cellpadding="2" cellspacing="0" style="width: 326px;"><tbody> <tr> <td valign="top" width="50"><strong>N</strong></td> <td valign="top" width="117"><strong>Day</strong></td> <td valign="top" width="155"><strong>Memory Aid</strong></td> </tr> <tr> <td valign="top" width="51">0</td> <td valign="top" width="118">Sunday</td> <td valign="top" width="153">None-day</td> </tr> <tr> <td valign="top" width="52">1</td> <td valign="top" width="119">Monday</td> <td valign="top" width="152">One-day</td> </tr> <tr> <td valign="top" width="52">2</td> <td valign="top" width="120">Tuesday</td> <td valign="top" width="152">Twos-day</td> </tr> <tr> <td valign="top" width="52">3</td> <td valign="top" width="120">Wednesday</td> <td valign="top" width="151">(3 is shaped like a W)</td> </tr> <tr> <td valign="top" width="52">4</td> <td valign="top" width="120">Thursday</td> <td valign="top" width="151">Fours-day</td> </tr> <tr> <td valign="top" width="52">5</td> <td valign="top" width="120">Friday</td> <td valign="top" width="151">Five-day</td> </tr> <tr> <td valign="top" width="52">6</td> <td valign="top" width="120">Saturday</td> <td valign="top" width="151">Six-urday</td> </tr> </tbody></table> </td> </tr> </tbody></table> <p>For example, the 7th of the example month can be figured as (7 - MFS) = (7 - 3) = 4 = Fours-day = Thursday. What if you were asked about the 2nd of this example month? You don’t want to subtract (2 - MFS) = (2 - 3) and get a negative number. Instead, add a seven into the calculation. In other words, ask yourself about the 9th instead of the 2nd. Answer: (9-3) = 6 = Six-urday = Saturday. (In the “Step 4” section below, another way of dealing with negative results is shown.) </p> <p>Another type of question easily handled with this “first Sunday” approach is this: What date is payday, the last Friday of this month? Easy, if you remember the MFS = 3, meaning this month’s first Sunday is the 3rd. Add 5 (the number corresponding to Friday) and you know the 8th is a Friday, then add three sevens to get to payday, the 29th. <br /></p> <p>What we have just learned is the reason for the one and only subtraction operation, which appears in step 4 of the algorithm. The steps before that compute the MFS. </p> <h2>What’s a doomsday?</h2> <p>The word “doomsday” was chosen by Dr. J. H. Conway for a reference point in each year. The year’s doomsday is the day of the week for the last day in February. Dr. Conway looked for dates of each month that had the same day-of-the-week as the year's doomsday. He knew he was on to something when he saw that 4/4, 6/6, 8/8, 10/10, and 12/12 all met this criterion. In 2011, for example, the last day of February is a Monday. Therefore we can also say that 4/4/2011, 6/6/2011, etc. are all Mondays. </p> <p>For our purposes, the month's doomsday is a number between zero and six, but an extra seven won't hurt: it's easier to remember 12/12 than December 5, the equivalent. <br />Here's the table of month’s doomsdays. <br /></p> <table border="1" cellpadding="2" cellspacing="3" style="width: 800px;"><tbody> <tr> <td valign="top" width="89"><strong>Month</strong></td> <td align="center" valign="top" width="78"><strong>Month Number</strong></td> <td align="right" valign="top" width="98"><strong>Month’s Doomsday</strong></td> <td align="center" valign="top" width="518"><strong>Memory Aid</strong></td> </tr> <tr> <td valign="top" width="94">January</td> <td align="center" valign="top" width="83">1</td> <td align="right" valign="top" width="102">3 or 4</td> <td valign="top" width="518">Use 3, three years out of four, but use 4 the fourth (leap) year</td> </tr> <tr> <td valign="top" width="98">February</td> <td align="center" valign="top" width="87">2</td> <td align="right" valign="top" width="105">o or 1</td> <td valign="top" width="518">Binary: leap year (1) or not (0) </td> </tr> <tr> <td valign="top" width="101">March</td> <td align="center" valign="top" width="90">3</td> <td align="right" valign="top" width="108">0</td> <td valign="top" width="518">The easiest month </td> </tr> <tr> <td valign="top" width="103">April</td> <td align="center" valign="top" width="92">4</td> <td align="right" valign="top" width="110">= 4</td> <td valign="top" width="518"> </td> </tr> <tr> <td valign="top" width="104">May</td> <td align="center" valign="top" width="93">5</td> <td align="right" valign="top" width="111">9</td> <td valign="top" width="518">“9 to 5”</td> </tr> <tr> <td valign="top" width="105">June</td> <td align="center" valign="top" width="94">6</td> <td align="right" valign="top" width="112">= 6</td> <td valign="top" width="518"> </td> </tr> <tr> <td valign="top" width="106">July</td> <td align="center" valign="top" width="95">7</td> <td align="right" valign="top" width="113">11</td> <td valign="top" width="518">“7-Eleven” </td> </tr> <tr> <td valign="top" width="106">August</td> <td align="center" valign="top" width="95">8</td> <td align="right" valign="top" width="113">= 8</td> <td valign="top" width="518"> </td> </tr> <tr> <td valign="top" width="106">September</td> <td align="center" valign="top" width="95">9</td> <td align="right" valign="top" width="113">5</td> <td valign="top" width="518">“9 to 5” </td> </tr> <tr> <td valign="top" width="106">October</td> <td align="center" valign="top" width="95">10</td> <td align="right" valign="top" width="113">= 10</td> <td valign="top" width="518"> </td> </tr> <tr> <td valign="top" width="106">November</td> <td align="center" valign="top" width="95">11</td> <td align="right" valign="top" width="113">7</td> <td valign="top" width="518">“7-Eleven” </td> </tr> <tr> <td valign="top" width="106">December</td> <td align="center" valign="top" width="95">12</td> <td align="right" valign="top" width="113">= 12</td> <td valign="top" width="518"> </td> </tr> </tbody></table> Just a few memory aids make this table easy: <br /> <ul> <li>Even months (except February) are trivial: use the month number. </li> <li>Odd months (except January and March) are “swapped” according to the phrase “Work 9 to 5 at the 7-Eleven”, as shown in the table. </li> <li>March is a zero. “Nothing” to remember! This happens because March's first Sunday <em>is</em> the year's first Sunday (definition below). </li> <li>February is a binary “switch”, telling whether the year is a leap year. After all, February is the leap month. </li> <li>January is a 3, three years out of four, but it’s a 4 the fourth year (the years divisible by 4). </li> </ul> <p>Now back to the goal, which is to find the first Sunday of a month in question (the MFS). The "formula" is simple: it's the year's first Sunday (YFS) plus the month's doomsday. </p> <p>MFS = YFS + MD </p> <p><strong>Definition: </strong>The year's first Sunday is the date of the first Sunday in March of the given year. It's a number between zero and six, which you'll use all year long. (When the first Sunday in March is the 7th, we say YFS=0.) </p> <p>[Tech note: Just as Dr. Conway observed that 6/6 had the same day of the week as the last day in February, I note that the date of June’s first Sunday is 6 more that the date of March's first Sunday. The year’s first Sunday is the sevens complement of Conway's year’s doomsday: YFS = 7 – YD, where YD is the day of the week of the last day in February.] <br /></p> <p>Section Summary: We showed the relationship between the MFS (our goal) and the YFS, which is the date of the first Sunday in March of the given year. The formula is: MFS = YFS + month’s doomsday. Fortunately, in using the algorithm, you won’t have to think in terms of variables or formulas. </p> <h2>Step 1</h2> <p>As shown in the summary chart below, here is the procedure for step 1: <br /></p> <table border="0" cellpadding="2" cellspacing="0" style="width: 771px;"><tbody> <tr> <td valign="top" width="200">T = yy</td> <td valign="top" width="569">We will keep a running total “T” through the four steps. Initially, its value is <strong>yy</strong>, the two-digit year.</td> </tr> <tr> <td valign="top" width="200">(if T is odd) T = T + 11 </td> <td valign="top" width="569">If the value is odd, add 11 to it. If even, do nothing.</td> </tr> <tr> <td valign="top" width="200">T = T / 2</td> <td valign="top" width="569">Divide T by 2. Easy, because T is even.</td> </tr> <tr> <td valign="top" width="200">(if T is odd) T = T + 11 </td> <td valign="top" width="569">If the value is odd, add 11 to it. If even, do nothing.</td> </tr> </tbody></table> <p>That’s it for step 1! To remember this procedure, use the name given by the inventors, Fong and Walters: <strong>“Odd+11”</strong>. The amazing thing about this little procedure is that it accounts for leap years with no division by 4, and no “remainder” operations. Another amazing thing is the ease of remembering the three operations: “Odd+11, divide by 2, odd+11”. </p> <p>[Tech note: The second addition of 11 could be “simplified” to an addition of 4 instead, since we immediately remove excess sevens. The simplicity of the repeated rule, however, outweighs the simplicity of the smaller number. Experts will also notice that, if the second "+11" is required, you can remove excess sevens before adding the 11 or 4.]</p> <p>At the end of this step, you may (and generally you should) remove excess sevens from the running total. </p> <h2>Step 2</h2> <p>The next step is to add the century's first Sunday (CFS) to the running total. </p> <p>The CFS is the date of the first Sunday in March (i.e. the YFS) for a year ending with 00. Here is a table showing the CFS for various centuries. Surprisingly, we need only four columns, not seven, for all centuries in the Gregorian (modern) calendar. <br /></p> <table border="1" cellpadding="2" cellspacing="0" style="width: 582px;"><tbody> <tr> <td align="center" valign="top" width="70"><strong>0</strong></td> <td align="center" valign="top" width="74"><strong>2</strong></td> <td align="center" valign="top" width="78"><strong>4</strong></td> <td align="center" valign="top" width="75"><strong>5</strong></td> <td valign="top" width="283"><= The century’s first Sunday (CFS) <br />Remember: “No tuna for Friday”</td> </tr> <tr> <td align="center" valign="top" width="72">n/a</td> <td align="center" valign="top" width="76">n/a</td> <td align="center" valign="top" width="79">1500</td> <td align="center" valign="top" width="76">1600</td> <td valign="top" width="283"> </td> </tr> <tr> <td align="center" valign="top" width="73">1700</td> <td align="center" valign="top" width="77">1800</td> <td align="center" valign="top" width="79">1900</td> <td align="center" valign="top" width="77">2000</td> <td valign="top" width="283">This row covers American history</td> </tr> <tr> <td align="center" valign="top" width="74">2100</td> <td align="center" valign="top" width="77">2200 </td> <td align="center" valign="top" width="79">etc.</td> <td align="center" valign="top" width="78"> </td> <td valign="top" width="283"> </td> </tr> </tbody></table> <p>The “nonsense phrase” to remind you of this table is "No tuna for Friday" (maybe you can come up with a better phrase). That gives you the table header, the CFS dates 0, 2, 4, 5. Recall that the relevant row of the table covers all of American history, the 1700s, 1800s, 1900s, and 2000s. For example, when solving for a date in the 1900s, you would count three pulses (or fingers): "1700, 1800 1900", associate that with "No tuna for", and you’ve got the CFS value, 4, to add to the running total. Future centuries are new rows in the table, as shown. </p> <p>[Tech note: To compute the CFS for any Gregorian centurial number (<strong>cc</strong>, the first two digits of the year), there is a simple formula, thanks to Lawrence Baker: CFS = ((<strong>cc</strong> mod 4) * 2 + 5) mod 7. For everyday, or recent history date work, I’d rather remember the “nonsense phrase”, and not introduce this extra arithmetic.] </p> <p>That’s it for step 2, unless you’re working on a date before Pope Gregory’s change to the calendar. <br /></p> <blockquote> <h3>Julian Dates</h3> <p>Before the Gregorian correction, the leap-year rules were simpler, and, likewise, step 2 of the first Sunday doomsday algorithm is very simple for these early centuries. </p> <p>What year is the dividing line between Julian and Gregorian dates? It depends on location. In Italy, it’s 1582, the year of the decree. In England and its colonies, it’s 1752. For a list telling when each region adopted the Gregorian calendar, see <a href="http://www.norbyhus.dk/calendar.html">this historian's site</a>. (The correction involves dropping days from the calendar. The web site just mentioned tells exactly which days were dropped in each region.) Assuming you know when the transition occurred, you can use the easy algorithm for Julian dates in the first part of the year, and use the regular algorithm for Gregorian dates after the correction. The only difference in the algorithm is the value of the CFS here in step 2. </p> <p>The value to use for CFS for dates prior to the Gregorian correction couldn’t be simpler: it’s just <strong>cc</strong>, the centurial number! This is because the first Sunday in March for the year 100 is the 1st; for year 200, March 2nd, and so on for 15 centuries. There are examples of Julian date calculations in the Examples section below. <br /></p> <h3>BC Dates</h3> You can even calculate days for the years 45 BC through 1 BC with some extra effort, and perhaps a pencil. You just need to use (57 – |year|) in place of the BC year; for example, instead of 2 BC you use 55 AD . This trick handles the "negativeness" of BC years, and also the fact that the BC years 1, 5, 9, etc. are leap years. (The number 57 works well because the result of the subtraction is a small number in the first century, so step 2 consists of adding zero, the value of <b>cc</b>. For Americans, 57 is also an easy number to remember due to ketchup advertising.) Unfortunately, the leap day was not February 29 in those days, so more study is needed to pin down BC dates in February. Fine print: this works for the proleptic Julian calendar.</blockquote> <p>Now that we’ve added the CFS to the running total, the result after step 2 (after perhaps removing excess sevens) is the YFS for the given year <strong>ccyy</strong>. If you remind yourself throughout the year of this value, you can skip the first two steps for all your date questions in the current year! You simply begin at step 3 with the YFS you remember. </p> <h2>Step 3</h2> <p>The next step is to add the month’s doomsday (for <strong>mm</strong>) to the running total. This comes from the table shown above in the “What’s a doomsday?” section. Once again, the math is just adding a small number to the running total. The memory aids shown in that table are all you need to come up with the number. </p> <p>The result of this step (after perhaps removing excess sevens) is the MFS for the given month. If you remind yourself throughout the month of this value, you can skip steps 1-3 for all your date questions in the current month! You simply begin at step 4 with the MFS you remember. <br /></p> <p>Tip: whenever you see a calendar, look at the number in the top of the Sunday column and say (for example) “this is a 3 month”. With this knowledge, you can enter the algorithm at step 4 with that “running total” (the MFS) for the given month. </p> <h2>Step 4</h2> <p>Subtract the running total (the MFS) from the date <strong>dd</strong>. This is what we did in the introductory section, “What’s a First Sunday”. I suggested there that you might need to add 7 to the date in question, to avoid a negative result of the subtraction. <br /></p> <p>There is another way to deal with the problem of subtracting a number that is larger than the date <strong>dd. </strong>The solution is to “negate the negative”, taking advantage of the fact that, in <a href="http://en.wikipedia.org/wiki/Modular_arithmetic">modular arithmetic</a>, <br /></p> <blockquote><strong>dd</strong> – T = 7 – (T – <strong>dd</strong>).</blockquote> <p>For example, if you end up with (2-3), just go ahead and compute the negative answer (-1), than take the sevens complement, 7-1 = 6, or Saturday. </p> <h2>Summary Chart</h2> <p>If you’ve read all the sections above, you may never need to refer back to them, because the following chart summarizes the entire procedure, including the memory aids. You may wish to print the chart and refer to it as you follow the examples, and then practice on more dates of your choosing. </p> <p>Of course, packing the whole method into one chart requires some abbreviation. The“math” column looks like a computer program, but the operations are very simple. Where brackets are used, like Table[x], it means x is converted to a new number by looking in a “table”. As you have seen, the “tables” are simple conversions you can remember thanks to some helpful phrases. <br /><span style="font-size: 130%;"></span></p> <h3><span style="font-size: 130%;">Summary of the First Sunday Doomsday Algorithm for the date <strong>mm/dd/ccyy</strong></span> </h3> <br /> <table border="2" cellpadding="2" cellspacing="0" style="width: 975px;"><tbody> <tr> <td valign="top" width="32"><strong>Step</strong></td> <td valign="top" width="182"><strong>Math</strong></td> <td valign="top" width="146"><strong>Description</strong></td> <td valign="top" width="611"><strong>Conversion Tables and Memory Aids</strong></td> </tr> <tr> <td valign="top" width="32">1.</td> <td valign="top" width="182">T = <strong>yy <br /></strong>(if T is odd) T = T + 11 <br />T = T / 2 <br />(if T is odd) T = T + 11</td> <td valign="top" width="146"> <br />If odd, add 11. <br />Then cut in half. <br />If odd, add 11.</td> <td valign="top" width="611"> <br />“<strong>Odd plus 11</strong>.” <br /> <br />“<strong>Odd plus 11</strong>.” Again.</td> </tr> <tr> <td valign="top" width="32">2.</td> <td valign="top" width="182">T = T + CFS_table[<strong>cc</strong>] <br /> <br /><span style="font-size: 78%;">(Result is YFS)</span></td> <td valign="top" width="146">Add the century’s first Sunday (CFS).</td> <td valign="top" width="611"> <table border="1" cellpadding="2" cellspacing="0" style="width: 569px;"><tbody> <tr> <td align="center" valign="top" width="61">1700s</td> <td align="center" valign="top" width="70">1800s</td> <td align="center" valign="top" width="76">1900s</td> <td align="center" valign="top" width="67">2000s</td> <td valign="top" width="293">Covers American history</td> </tr> <tr> <td align="center" valign="top" width="61">0</td> <td align="center" valign="top" width="70">2</td> <td align="center" valign="top" width="76">4</td> <td align="center" valign="top" width="67">5</td> <td valign="top" width="293">(Remember<strong> “No tuna for Friday.”</strong>)</td> </tr> </tbody></table> (For years prior to the Gregorian correction, use CFS = <strong>cc</strong>.)</td> </tr> <tr> <td valign="top" width="32">3.</td> <td valign="top" width="182">T = T + MD_table[<strong>mm</strong>] <br /> <br /> <br /> <br /> <br /> <br /><span style="font-size: 78%;">(Result is MFS)</span></td> <td valign="top" width="146">Add the month’s doomsday. </td> <td valign="top" width="611"> <table border="0" cellpadding="2" cellspacing="0" style="width: 551px;"><tbody> <tr> <td valign="top" width="136">Even month (except 2):</td> <td valign="top" width="413">Use the month number.</td> </tr> <tr> <td valign="top" width="136">Odd month (except 1 or 3):</td> <td valign="top" width="413">Switch according to <strong>“Work 9 to 5 at 7-eleven.”</strong> </td> </tr> <tr> <td valign="top" width="136">January:</td> <td valign="top" width="413">Use 3, <strong>three</strong> years out of four, but use 4 for leap years. </td> </tr> <tr> <td valign="top" width="136">February:</td> <td valign="top" width="413">Use zero, but use 1 for leap years. It’s a binary switch. </td> </tr> <tr> <td valign="top" width="136">March:</td> <td valign="top" width="413">Use zero. March is the easiest month.</td> </tr> </tbody></table> </td> </tr> <tr> <td valign="top" width="32">4.</td> <td valign="top" width="182">Day = <strong>dd</strong> – T</td> <td valign="top" width="146">Subtract total from <strong>dd.</strong></td> <td valign="top" width="611"> <table border="1" cellpadding="2" cellspacing="0" style="width: 596px;"><tbody> <tr> <td valign="top" width="81">0=Sunday</td> <td valign="top" width="84">1=Monday</td> <td valign="top" width="88">2=Tuesday</td> <td valign="top" width="63">3=Wed.</td> <td valign="top" width="96">4=Thursday</td> <td valign="top" width="74">5=Friday</td> <td valign="top" width="108">6=Saturday</td> </tr> <tr> <td valign="top" width="81">None-day</td> <td valign="top" width="84">One-day</td> <td valign="top" width="88">Twos-day</td> <td valign="top" width="63">3 = “w”</td> <td valign="top" width="96">Fours-day</td> <td valign="top" width="74">Five-day</td> <td valign="top" width="108">Six-urday</td> </tr> </tbody></table> </td> </tr> </tbody></table> <h2> </h2> <h2>Examples</h2> <p>The following examples show very concisely the four-step manipulation of the running total, leading to the resulting day of the week. One abbreviation needs explanation: a semicolon represents the subtraction of excess sevens. </p> <p>What day was July 4, 1776 (U.S. independence day)? <br /></p> <table border="0" cellpadding="2" cellspacing="0" style="width: 898px;"><tbody> <tr> <td valign="top" width="19">1.</td> <td valign="top" width="186">76 / 2 = 38 <br />38; 3</td> <td valign="top" width="691"><strong>yy</strong> is even, just cut in half. <br /><strong>T</strong> is even, nothing to add. Then subtract sevens (38-35=3).</td> </tr> <tr> <td valign="top" width="29">2.</td> <td valign="top" width="186">+ 0 = 3</td> <td valign="top" width="691">First entry in the century table (first century in American history), so use the first word of “<strong>No</strong> tuna for Friday”. “No” stands for zero.</td> </tr> <tr> <td valign="top" width="33">3.</td> <td valign="top" width="186">+ 11 = 14; 0</td> <td valign="top" width="691">The month (<strong>mm</strong>=7) gets switched to 11 according to the phrase “Work ... at 7-eleven”. Then remove a pair of sevens.</td> </tr> <tr> <td valign="top" width="37">4.</td> <td valign="top" width="186">4 - 0 = 4. Thursday</td> <td valign="top" width="691"><strong>dd</strong>=4. Result 4 = “Fours-day”.</td> </tr> </tbody></table> <p>Wow, we got lucky four times in that example. We avoided both “add 11” operations in step 1. Second, the CFS for the 1700s (step 3) was zero. And third, after removing excess sevens in step 4, the running total dropped to zero, making the final subtraction trivial. <br /></p> <p>The next example won’t have all those lucky breaks. What day was May 1, 1895? <br /></p> <table border="0" cellpadding="2" cellspacing="0" style="width: 907px;"><tbody> <tr> <td valign="top" width="19">1.</td> <td valign="top" width="187">95 + 11 = 106 <br />/ 2 = 53 <br />+ 11 = 64; 1</td> <td valign="top" width="699"><strong>yy</strong> is odd, so add 11. <br />Cut in half. <br /><strong>T</strong> is odd, so add 11. Remove excess sevens (64-63=1).</td> </tr> <tr> <td valign="top" width="28">2.</td> <td valign="top" width="187">+ 2 = 3</td> <td valign="top" width="699">Recall the century table, “1700s, 1800s”. For <strong>cc</strong>=18, use the second word of “No <strong>tuna</strong> for Friday”. “Tuna” stands for 2.</td> </tr> <tr> <td valign="top" width="32">3.</td> <td valign="top" width="187">+ 9 = 12; 5</td> <td valign="top" width="699">The month (<strong>mm</strong>=5) gets switched to 9 according to “Work 9 to 5...” . Then remove an excess seven.</td> </tr> <tr> <td valign="top" width="36">4.</td> <td valign="top" width="187">1 – 5 = -4?? <br />7 – (5-1) = 3. Wednesday</td> <td valign="top" width="699">Darn, that’s going to be negative, so… <br />Go ahead and find the negative answer, then take the sevens complement. Result is 3, “Wednesday”.</td> </tr> </tbody></table> <p> </p> <p>August 4, 1962 <br /></p> <table border="0" cellpadding="2" cellspacing="0" style="width: 907px;"><tbody> <tr> <td valign="top" width="39">1.</td> <td valign="top" width="188">62 / 2 = 31 <br />+ 11 = 42; 0</td> <td valign="top" width="683"><strong>yy</strong> is even, just cut in half. <br /><strong>T</strong> is odd, so add 11. Remove excess sevens.</td> </tr> <tr> <td valign="top" width="39">2.</td> <td valign="top" width="188">+ 4 = 4</td> <td valign="top" width="683">Add 4 for the 1900s. (“No tuna <strong>for</strong> Friday”.</td> </tr> <tr> <td valign="top" width="39">3.</td> <td valign="top" width="188">+ 8 = 12; 5</td> <td valign="top" width="683">Even month; use the month number. Remove a seven.</td> </tr> <tr> <td valign="top" width="39">4.</td> <td valign="top" width="188">4 – 5 = –1?? <br />7-1 = 6. Saturday</td> <td valign="top" width="683">Figure the negative result, <br />then complement to get 6, “Saturday”.</td> </tr> </tbody></table> <p> </p> <p>December 7, 1941 (Pearl Harbor day) <br /></p> <table border="0" cellpadding="2" cellspacing="0" style="width: 907px;"><tbody> <tr> <td valign="top" width="39">1.</td> <td valign="top" width="188">41 + 11 = 52 <br />/ 2 = 26 <br />26</td> <td valign="top" width="683"><strong>yy</strong> is odd, so add 11. <br />Cut in half. <br /><strong>T</strong> is even, nothing to add.</td> </tr> <tr> <td valign="top" width="39">2.</td> <td valign="top" width="188">+ 4 = 30; 2</td> <td valign="top" width="683">Add 4 for the 1900s. Remove sevens.</td> </tr> <tr> <td valign="top" width="39">3.</td> <td valign="top" width="188">+ 12 = 14; 0</td> <td valign="top" width="683">Even month; use the month number. Remove sevens.</td> </tr> <tr> <td valign="top" width="39">4.</td> <td valign="top" width="188">7 – 0 = 7; 0. Sunday</td> <td valign="top" width="683">None-day.</td> </tr> </tbody></table> <p> </p> <p>December 31, 1899 <br /></p> <table border="0" cellpadding="2" cellspacing="0" style="width: 907px;"><tbody> <tr> <td valign="top" width="39">1.</td> <td valign="top" width="188">99 + 11 = 110 <br />/ 2 = 55 <br />+ 11 = 66; 3</td> <td valign="top" width="683"><strong>yy</strong> is odd, so add 11. <br />Cut in half. <br /><strong>T</strong> is odd, so add 11. Remove excess sevens.</td> </tr> <tr> <td valign="top" width="39">2.</td> <td valign="top" width="188">+ 2 = 5</td> <td valign="top" width="683">Add 2 for the 1800s.</td> </tr> <tr> <td valign="top" width="39">3.</td> <td valign="top" width="188">+ 12 = 17; 3</td> <td valign="top" width="683">Even month; use the month number. Remove sevens.</td> </tr> <tr> <td valign="top" width="39">4.</td> <td valign="top" width="188">31 – 3 = 28; 0. Sunday</td> <td valign="top" width="683">None-day.</td> </tr> </tbody></table> <p> </p> <p>January 1, 1900 (The next day, to test the previous example’s answer) <br /></p> <table border="0" cellpadding="2" cellspacing="0" style="width: 907px;"><tbody> <tr> <td valign="top" width="39">1.</td> <td valign="top" width="188">0 / 2 = 0 <br />0</td> <td valign="top" width="683">Even, so just divide by 2. <br /><strong>T</strong> is even, nothing to add.</td> </tr> <tr> <td valign="top" width="39">2.</td> <td valign="top" width="188">+ 4 = 4</td> <td valign="top" width="683">Add 4 for the 1900s.</td> </tr> <tr> <td valign="top" width="39">3.</td> <td valign="top" width="188">+ 3 = 7; 0</td> <td valign="top" width="683">1900 was not a leap year, so this January's doomsday is 3, not 4!</td> </tr> <tr> <td valign="top" width="39">4.</td> <td valign="top" width="188">1 – 0 = 1. Monday</td> <td valign="top" width="683">One-day.</td> </tr> </tbody></table> <p> </p> <p>October 14, 1066 (The Battle of Hastings, Julian calendar) <br /></p> <table border="0" cellpadding="2" cellspacing="0" style="width: 907px;"><tbody> <tr> <td valign="top" width="39">1.</td> <td valign="top" width="188">66 / 2 = 33 <br />+ 11 = 44; 2</td> <td valign="top" width="683">Even, so just divide by 2. <br /><strong>T</strong> is odd, so add 11. Remove excess sevens.</td> </tr> <tr> <td valign="top" width="39">2.</td> <td valign="top" width="188">+ 10 = 12</td> <td valign="top" width="683">Simply add the centurial number <strong>cc</strong> for Julian years!</td> </tr> <tr> <td valign="top" width="39">3.</td> <td valign="top" width="188">+ 10 = 22; 1</td> <td valign="top" width="683">Even month; use the month number. Remove sevens.</td> </tr> <tr> <td valign="top" width="39">4.</td> <td valign="top" width="188">14 – 1 = 13;6. Saturday</td> <td valign="top" width="683">Six-urday.</td> </tr> </tbody></table> <p> </p> <p>Another advantage of the first Sunday method is how it helps answer questions like the following:</p> <p>What’s the date of Thanksgiving in 2013? Let’s run the algorithm through step 3. Since 13 is odd, we add 11 to get 24, Cut in half, getting 12 (even, nothing to add). Add the CFS (5 for the two-thousands), to get 17, remove sevens, result 3. The month’s doomsday for November is 7 (remember 7-Eleven), same as zero, so the total remains 3 as the month’s first Sunday. For the first Thursday (“Fours-day”), just add 4 to the MFS: 3 + 4 = 7. The Thursdays in November 2013 are on these dates: 7, 14, 21, and 28. Thanksgiving (fourth Thursday) is the 28th. </p> <p>Easiest of all are Mother's Day (second Sunday in May) and Father's Day (third Sunday in June).</p> <h2>Final note</h2> <p>Do you know why there are seven days in a week? Thousands of years before the current era, the Egyptians had seven “sky gods”. Unlike modern gods, these can be seen by anyone; they are the sun, the moon, and the five “wandering stars”, i.e. the planets visible without a telescope. Sunday and Monday are obvious, and if you know a little French (or Spanish or Italian), you can spot the other planets thus: Tuesday (Mardi in French) is Mars, Wednesday (Mercredi) is Mercury, Thursday (Jeudi) is Jupiter, Friday (Vendredi) is Venus, and of course Saturday is Saturn, the highest of the gods. Next time you say “24/7”, thank the ancient Egyptians, who invented hours as well as weeks. </p> <h2>Why it works</h2> <p>Lewis Carroll (pen name of Charles Lutwidge Dodgson), writing in <em>Nature</em> in 1887, presented a day-of the week method which set the standard for all methods to come. He required one to add together a “Century-Item,” a Year-Item, a Month-Item, and a Day-Item. The first Sunday method follows this same plan, but there is one disturbing difference: Where Carroll simply added the day-item (the day of the month <strong>dd</strong>) to the total, my fourth step requires a subtraction. How can this be better?</p> <p>In the first Sunday method I have chosen the best available algorithms for the year-item, the century-item, and the month-item. In <em>all three cases</em>, it was best to produce a value which was not added to the day-item <strong>dd</strong>, but subtracted from it instead. Furthermore, adding the three “negative” items together happens to produce the month’s first Sunday (MFS), which has great practical value. The single subtraction that is required, in the fourth and final step, is justified by this practicality and by the simplicity of the other three steps. Following is the explanation for the “negative” nature of those three steps.</p> <p>The year-item (our step 1) is “negative” because of the Fong-Walters “Odd+11” method, which is so well suited to mental calculation. Its result would have to be complemented to produce a value to add to a total with the day-item. The “Odd+11” method, applied to the year <strong>yy</strong>,<strong> </strong>happens to produce the date of the first Sunday in March, for that year in the first century.</p> <p> Carroll’s original method for the year-item was “positive,’ and good enough for Conway to keep in his method. In brief, you add together the number of dozens in <strong>yy</strong>, the remainder of <strong>yy</strong>/12, and the number of fours in the remainder. </p> <p>The century-item (our step 2) is “negative” because of the simplicity of using <strong>cc </strong>directly for Julian dates. This works because the first Sunday in March for the year 100 is the 1st; for the year 200, March 2nd, and so on for 15 centuries. For Gregorian dates, Lawrence Baker’s <a href="http://members.cox.net/lab1215/~Tools/COWAFOGO%20Weekday%20Solving%20Simplified.pdf">formula</a>, 5+2(<strong>cc</strong> mod 4), is preferable to its complement, which Carroll used. (Carroll’s formula was 2(3-<strong>cc</strong> mod 4). The requirement for subtraction–actually a fours complement–makes it less desirable.)</p> <p>The month-item (our step 3) is “negative” because Conway’s discovery, which uses the even month numbers directly and the “9 to 5 at 7-eleven” phrase, is so easy to remember. This “negativity” is what introduces a single subtraction in both Conway’s method and mine. Lewis Carroll’s original month-item, though it was indeed “positive,” was quite convoluted.</p> <p>Others have presented methods with a “positive” month-item, but they require memorizing a table of values for the months. These include Justin White’s method at his <a href="http://calendarhome.com/human/">calendarhome.com</a> web site, and Arthur Benjamin and Michael Shermer’s similar method presented in their book, Secrets of Mental Math.<a href="file:///C:/Users/Bob/Desktop/Kindle/#_edn3" name="_ednref3">[1]</a> </p> <p>There are other stars that aligned to make the first Sunday method work. Calling Sunday the zero day, Monday number one, etc., as Carroll did in 1887, yields good mnemonics like “Twos-day.” It also happens to match the international standard for dates, ISO8601, which counts Monday as number 1, and Sunday as 7. Finally, consider the first Sunday in March of the “year zero.” This is not a trick question – the year before AD 1 was the year we now call 1 BC. The first Sunday in March was on the 7<sup>th</sup>, making a perfect zero to which we can start adding our items. <br /></p> <hr align="left" size="1" width="33%" /> <p><a href="file:///C:/Users/Bob/Desktop/Kindle/#_ednref3" name="_edn3">[1]</a> Benjamin, Arthur and Michael Shermer <em>Secrets of mental math : the mathemagician’s guide to lightning calculation and amazing math tricks</em>. New York: Three Rivers Press, 2006 p. 214 (Originally published in different form as Mathemagics by Lowell House, Los Angeles, in 1993.)</p> Bob Goddardhttp://www.blogger.com/profile/03308815202377527967noreply@blogger.com