A Simple Formula for the Weekday

People skilled in mental arithmetic sometimes amaze friends and colleagues by calculating the day of the week on which a given date falls. Thus, given a date, say D-Day, which was on 6 June 1944, they quickly announce that it was a Tuesday.

Techniques for calculating the day of the week for a given date have been a subject of research for centuries. Carl Friedrich Gauss wrote about the topic in 1798 but, true to form, he never published it. It was included in his Collected Works, published 1927, in a paper entitled “How to find the weekday of the First of January of any Year”.

Later, the mathematician Charles Dodgson, better known as Lewis Carroll, author of the Alice books, published a letter in Nature on the subject. Gauss and Carroll used similar approaches: (1) choose a particular day, such as the first of January, as an anchor day; (2) find a formula to calculate the weekday of the anchor in a given year; (3) make an adjustment for the given month and day.

Doomsday Method

Mnemonic for Day Numbers

A problem with the methods of Gauss and Carroll is that the calculation becomes awkward when the given date is far away from the anchor day. To overcome this, the remarkable mathematician John H. Conway developed a method that he called the Doomsday Method. He practised regularly — his computer was programmed to display random dates each time he logged on — and his calculation time was just a few seconds. Conway simplified the calculations by fixing a separate anchor day for each month. The algorithm he used to compute the weekdays was quite similar to that of Lewis Carroll.

Let the days of the week from Sunday to Saturday be numbered from 0 to 6. Then the answer we want will be in the set {\{0, 1, 2, 3, 4, 5, 6 \}}. Conway suggested naming the weekdays as “Noneday”, “Oneday”, “Twosday”, “Treblesday”, “Foursday”, “Fiveday”, and “Six-a-day” to aid memory of the day number without counting.

Conway’s method requires us to memorise the Doomsday Number for each of the twelve months (see Table below) but it is worth the effort as this simplifies and speeds up the calculations.

Nakai’s Formula

Recently, a modification of the Doomsday Method was published in the popular magazine The Mathematical Intelligencer by Hirofumi Nakai of Tokyo City University. Nakai presented a new simple formula for calculating the weekday that is easily remembered and suitable for rapid mental calculation.

We will summarise the method of Nakai, omitting details and proofs, which can be found in the paper in The Mathematical Intelligencer. Suppose the year is {Y = 100c + y} with {c} the century and {y\in\{0,1,2, \dots ,99\}}. The conditions for a leap-year are

\displaystyle (y\ne 0 \land 4\ |\ y )\ \ \mbox{or}\ \ ( y = 0 \land 4\ |\ c ) \,.

We express {c} and {y} as multiples of {4} plus remainders:

\displaystyle c = 4c_1 + c_2, \quad y = 4y_1 + y_2, \quad c_2, y_2 \in \{0, 1, 2, 3\} \,.

In the following, all equations are considered modulo 7. Nakai shows that the day of the week for the Doomsdays is

\displaystyle g(n) = 5(c_2 + y_2 - 1) + 10y \,. \ \ \ \ \ (1)

Nakai points out two advantages of his formula over previously proposed ones:

  1. It uses only the remainder on division, so there are fewer items to memorize during the calculation
  2. It is easy to multiply by 5 or 10 in the decimal system.

A different set of anchor days may be used by changing the integer {k} in the formula

\displaystyle g(n) = 5(c_2 + y_2 - k) + 10y \,.

Fuller details are available in Nakai (2023). We conclude with a few examples to illustrate the technique.

Example I: 9/11 or 11 September, 2001. We have {(c,y) = (20, 01)}. The remainders when this is divided by 4 are {(c_2, y_2) = (0, 1)}, so formula (1) gives

\displaystyle g(n) = 5(c_2 + y_2 - 1) + 10y = 5(0 + 1 - 1) + 10\times 1 = 10 \equiv 3\ (\mbox{mod}\ 7)

Thus, Doomsday for this date is 3, that is, Wednesday. The difference between the date 11 and the Doomsday for September (namely 5) is {11 - 5 = 6}, so 11 September 2001 was day {3 + 6 = 9 \equiv 2} or Twosday. Therefore, 9/11 was on a Tuesday.

Example II: D-Day, 6 June, 1944. We have {(c,y) = (19, 44)}. The remainders when this is divided by 4 are {(c_2, y_2) = (3, 0)}, so formula (1) gives

\displaystyle g(n) = 5(c_2 + y_2 - 1) + 10y = 5(3 + 0 - 1) + 10\times 44 = 450 \equiv 2\ (\mbox{mod}\ 7)

Thus, Doomsday for this date is 2, that is, Wednesday. The difference between the date 6 and the Doomsday for June (namely 6) is 0, so 6 June 1944 was day {2 + 0 = 2} or Twosday. ThereforeD-Day was on a Tuesday.

Finally, we remark that Linux users can just type “cal June 1944′‘ to get:But perhaps you feel that this is cheating!

Sources

{\bullet} Lewis Carroll, 1887: To find the day of the week for any given date. Nature, 35, pg. 517.

{\bullet} John H. Conway, 1973: Tomorrow is the day after Doomsday. Eureka, 36, 28–32.

{\bullet} Carl Friedrich Gauss, 1798: Den Wochentag des 1. Januar eines Jahres zu finden. Gauss Werke XI, (1927), 206–210.

{\bullet} Hirofumi Nakai, 2023: A Simple Formula for Doomsday. The Mathematical Intelligencer, Volume 45, Issue 2, 131–132.

{\bullet} Wikipedia: Doomsday rule. URL.

{\bullet} Wikipedia: Gaußsche Wochentagsformel. URL.