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

$$ n=100c+y, \quad y =0, 1, \ldots , 99, $$
(1)

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

$$ c= 4c_{1}+c_{2}, \quad y=4y_{1}+y_{2}, \quad c_{2}, y_{2} \in \{ 0,1,2,3 \}. $$

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

$$ f(n) = (2-2c_{2}) + (y+y_{1}). $$

Furthermore, this formula can be modified as follows.

Proposition 1.

The day of the week for Doomsday in the year \(n=100c+y\) is

$$ g(n) = 5(c_{2}+y_{2}-1) + 10y. $$

Proof.

Calculation modulo 7 shows that

$$\begin{aligned} g(n) - f(n)&= 5(c_{2}+y_{2}-1) + 10(4y_{1}+y_{2})\\&\quad - (2-2c_{2}) - (5y_{1}+y_{2}) = 0, \end{aligned}$$

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

$$ g(n) = 5(c_{2}+y_{2}-k) + 10y. $$

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.