Avoid common mistakes on your manuscript.
The research for calculating the day of the week for any given date goes back to Carl Friedrich Gauss [3]. This topic was later addressed in [1] by Lewis Carroll, known as the author of Alice in Wonderland, and it became a topic of widespread interest.
The method that Gauss and Carroll adopted is as follows: determine a day in the year as the benchmark (called the anchor day), give the formula for calculating the day of the week for the anchor day, and then add the difference between the day of the year for the given date and the anchor day. Gauss set January 1 for his anchor day, while Carroll chose a virtual March 0. If you set only one anchor day per year, then the calculation will be somewhat difficult if the anchor day and the given date happen to be far apart. John Conway [2] avoided this difficulty by choosing an anchor day from each month (all of which will be on the same day of the week). However, the formula he used to calculate the day of the week for his anchor days (which he called Doomsdays) is essentially the same as Carroll’s, and there has not been much improvement on the formula since then.
In this note we present a new formula for calculating the day of the week for Doomsday that is easy to remember and makes mental calculations easy.
The Trick, The Result, and Some Examples
Let the days of the week from Sunday to Saturday be numbered from 0 to 6. Then the formula we want will take its value in the set \(\{ 0,1,2,3,4,5,6 \}\). Our first problem is to determine the variables that such a formula should have.
The following discussion will be based on the currently used Gregorian calendar. Let the number n representing a year be denoted by
where c is the century, and y is the year within the century. Since a necessary and sufficient condition for n to be a leap year is that either \(y \ne 0\) and \(4 \mid y\) or \(y = 0\) and \(4 \mid c\), we determine that the formula we seek should include the variables c and y.
On the other hand, experience shows that it is not reasonable to include the number m representing the month in the formula. The main reasons are that (i) there is no mathematical regularity in the number of days in each month, and (ii) exceptions due to leap years cannot be formulated well. There are several formulas in the literature involving m despite these difficulties. They do not seem suitable, however, for mental arithmetic (cf. [4]).
As we mentioned, Conway [2] suggested setting an anchor day (or Doomsday) for each month, since then one would have only to consider the difference between the day of the week for any given date and the Doomsday in that month:
Doomsdays | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Month Number | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
Day Number | 31 | 28 | 7 | 4 | 9 | 6 | 11 | 8 | 5 | 10 | 7 | 12 |
Note that it is required to add 1 to the days of January and February in leap years.
Now we consider a concrete formula to find the day of the week for Doomsday. In the following, all equations are considered modulo 7. For an integer n, define c and y as in (1), and express them as
By the rules of the Gregorian calendar, the day of the week for a Doomsday (e.g., March 7) in the year represented by the number 100c is \(2-2c_{2}\). In fact, when \(c_{2}=0, 1, 2, 3\), the respective days of the week for Doomsday are Tuesday (2), Sunday (0), Friday (5), Wednesday (3).
There is a leap year every four years between 100c and \(100(c+1)\). Since there are 365 days (\(= 1\) modulo 7) in a normal year and 366 days (\(= 2\) modulo 7) in a leap year, the day of the week for a given day in the year increases from one year to the next by 1 in a nonleap year and by 2 in a leap year. As a result, y years after 100c, the day of the week for the given day will have increased by \(y + y_{1}\). Therefore, the day of the week for Doomsday in the year \(n = 100c + y\) is given by
Furthermore, this formula can be modified as follows.
Proposition 1.
The day of the week for Doomsday in the year \(n=100c+y\) is
Proof.
Calculation modulo 7 shows that
which means that the two formulas give the same day of the week. \(\square \)
The advantages of the above formula over those previously given are twofold. First, it uses only the remainder on division (recall that the corresponding formulas used by [1] and [2] need both the quotient and the remainder), and so there are fewer items to memorize during the calculation. Second, it is easy to multiply by 5 or 10 in the decimal system. The only difficulty is that one may have to deal with a slightly larger number (at most three digits) in most cases on multiplying a two-digit number by 10. This represents only a small problem, however, since one can calculate modulo 7 at each step to keep the numbers small.
Remark 2.
If you want to use a different anchor day from Conway’s Doomsday, then you may change the value of the integer k in the formula
Example 3
(September 17, 1826). The remainder on dividing \((c,y) = (18,26)\) by 4 is \((c_{2},y_{2}) = (2,2)\), which gives \(5(2+2-1)=15=1\); 10 times y is \(10 \cdot 26 = 10 \cdot 5 = 1\), so Doomsday for 1826 is \(1 + 1 = 2\), that is, Tuesday. The difference between 17 and the Doomsday in September (namely 5) is \(17 - 5 = 12\), so September 17, 1826, was day \(2 + 12 = 14 = 0\), i.e., Sunday.
Example 4
(January 24, 1984). The remainder on dividing \((c,y) = (19,84)\) by 4 is \((c_{2},y_{2}) = (3,0)\), which gives \(5(3+0-1)=10=3\); 10 times y is \(10 \cdot 84 = 10 \cdot 0 = 0\), so Doomsday in 1984 is \(3 + 0 = 3\), Wednesday. The difference between 24 and the Doomsday in January of a leap year (namely 4) is \(24 - 4 = 20\), so the answer is \(3 + 20 = 23 =2\), Tuesday.
Change history
08 August 2023
A Correction to this paper has been published: https://doi.org/10.1007/s00283-023-10292-4
References
L. Carroll. To find the day of the week for any given date. Nature 35 (1887), 517.
J. H. Conway. Tomorrow is the day after Doomsday. Eureka 36 (1973), 28–32.
C. F. Gauss. Den Wochentag des 1. Januar eines Jahres zu finden. Güldene Zahl. Epakte. Ostergrenze. Carl Friedrich Gauss Werke XI (1927), 206–210 (originally published in 1798).
C. Zeller. Die Grundaufgaben der Kalenderrechnung auf neue und vereinfachte Weise gelöst. Württembergische Vierteljahrshefte für Landesgeschichte V (1882), 313–314.
Acknowledgments
In 2021, I suggested to my student Shogo Matsuki that he study the history of day-of-the-week calculations as his undergraduate research project. That was the trigger for me to think about Conway’s Doomsday algorithm. I would like to thank him for discussions about this matter.
Author information
Authors and Affiliations
Corresponding author
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Nakai, H. A Simple Formula for Doomsday. Math Intelligencer 45, 131–132 (2023). https://doi.org/10.1007/s00283-022-10229-3
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00283-022-10229-3