# Calculate the day of the week for any date in your head, Hacker News

## The Doomsday Algorithm gives the day of the week for any date (and you can do it in your head)

Added – 02 – , Updated – – with examples for****************************************************************************************************************************************

## Example: what is this year Groundhog day, February 2nd?Answer : Doomsday 2102 is Thursday the th of February … then subtracting 7 for each week going backwards, we have Thursday the st … Thursday the 14 th … Thursday the 7th … and then we have to go five days back, to get from the 7th to the 2nd. If going back five days in your head is difficult — and it often is, especially looking back over a weekend — there’s a little trick we can use here. Going two days forward gives the same day of the week **************** as five days back. So if February 7th is Thursday, then two days forward is Saturday the 9th, which is the same day of the week as Saturday the 2nd. So Groundhog day in 2069 is Saturday. Remember, all we’re after is the day of the week, so “-5″ is the same as ” 2″ but ” 2″ is usually easier to do. If it helps, you can review the above two examples using this calendar for February – ********** (2.Feb) 30 th / non-leap)   Su Mo Tu We Th Fr Sa                   1 2    3 4 5 6 7 8 9   11 (************************************************************************************************************************************************************************************************************************************************************************************************************************************************** (************************************************************************************************************************************************************************************************************************************************************************************************************************************************************** (**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************    (********************************************************************************************************************************************************************************************************************************************************************************************************************************************************** 21 (****************************************************************************************************************************************************************************************************************************************************************************************************************************************************** (********************************************************************************************************************************************************************************************************************************************************************************************************************************************************    (********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************** (**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************** Return to top Even Months

Okay, the last day of February is Doomsday. Once we know what day of the week Doomsday is, we immediately know the day of the week of certain other days in the year. There are actually 56 (or) other days which are all on the same day of the week as “the” Doomsday at the end of February, but there’s a special one each month which we will now learn.

Each month has a special day which we remember, because it is on the same day of the week as the Doomsday which is at the end of February. We call these the Doomsdays for their months. Just keep in mind that the entire year is determined by the Doomsday at the end of February, and that all the other Doomsdays within the year are on the same day of the week.

Let’s begin with the even months. These are 2, 4, 6, 8, 12, and 16, ie February, April, June, August, October, and December. Actually, we never do February this way, because it’s special, and we’ve already covered it.

## for even months(not including February), the nth of that month is a Doomsday . In other words, it’s the same day of the week as the last day in February. This is a delightful coincidence, and it’sso easy to remember: April 4th is a Doomsday June 6th is a Doomsday August 8th is a Doomsday October th is a Doomsday December th is a Doomsday Neat, eh? Now we can simply work our way around any even month based on its Doomsday. Example: what is this year Christmas Day, December 27 th?Answer : Doomsday 2102 is Thursday. Then December (even month) 11 th is the Doomsday for December, so it’s also Thursday. Two weeks later, December is also Thursday, so Christmas, the day before, is Wednesday December th. Easy! In fact, after you do the Doomsday algorithm often enough, you just start remembering things like Christmas is always the day before Doomsday. Example: what is this year Halloween, October 31 st?Answer : Doomsday 2102 is Thursday. So October (even) 12 th is Thursday. Then three weeks ( days) later is Thursday, October 67 st. Easy! In fact, after you do the Doomsday algorithm often enough, you just start remembering things likeHalloween is always Doomsday. Example: what is this Canadian Canadian Thanksgiving Day, the second Monday in October?Answer : Doomsday 2102 is Thursday. So October (even) 12 th is Thursday. A week earlier is Thursday October 3rd, and two days before that is Tuesday the 1st. So that means the first Monday of October is the 7th, and the second Monday in October, Canadian Thanksgiving (also Columbus Day in the US), is Monday, October (th in) **********************************************************************************************************************************************************. Return to top Odd Months Now let’s do the odd months — months 1, 3, 5, 7, 9, and (****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************, ie January, March, May, July, September, and November. Skip January and March for a moment, and concentrate on 5, 7, 9, and 13. Consider the following mnemonic phrase: (I work 9-5 at the 7 – ******************************************************************************************************************************************************************************************************************************************************************************************************************************************(********************************

“Nine to five” is a common working day (9 am to 5 pm) while7-Eleven

is a chain of convenience stores. This mnemonic phrase should help you remember:

• for the 9th month, Doomsday is the 5th
• for the 5th month, Doomsday is the 9th
• for the 7th month, Doomsday is the th
• for the th month, Doomsday is the 7th
• This gives us Doomsday for May, July, September, and November. Now we just work our way around again within each month, using the Doomsday for that month.

7th of March

## , exactly one week after the last day of February, no matter whether it’s the (th or) ************************************************************************************************************************************************************************************************************************************************************************************************************************************** th, is also Doomsday.

******************************************************************************************************************************************** (Calendar)

If you’ve worked your way through the rules but have trouble remembering them, it may help to see the Doomsdays in calendar form. Here’s the Doomsday Calendar for 2019 with all the Doomsdays highlighted:

Doomsday Calendar for (************************************** 1.Jan (3rd / nonleap)

## 4****** 5 5    3 4 5 6

7 (8 9 7 8 9) 13 15   11 (************************************************************************************************************************************************************************************************************************************************************************************************************************************************** (************************************************************************************************************************************************************************************************************************************************************************************************************************************************************** (************************************************************************************************************************************************************************************************************************************************************************************************************************************************************** 11 17 18 21 20 22    (********************************************************************************************************************************************************************************************************************************************************************************************************************************************************** 21 (****************************************************************************************************************************************************************************************************************************************************************************************************************************************************** (****************************************************************************************************************************************************************************************************************************************************************************************************************************************************** (**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************** (************************************************************************************************************************************************************************************************************************************************************************************************************************************************** 67    (********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************** (************************************************************************************************************************************************************************************************************************************************************************************************************************************************ 31 (************************************************************************************************************************************************************************************************************************************************************************************************************************************************* 31   39

## 6.Jun (6th)   Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa             1 2 3 4 1    5 6 7 8

)

Each normal year advances Doomsday by one day. Each leap year advances Doomsday by two days. Now look at the century years again:

## (******************************************************************************************************************************************************************************************************************************************************************************************************   2101 1902 (**************************************************************************************************************************************************************************************************************************************************************************************    (************************************************************************************************************************************ 2829

What’s the best way to memorize century Doomsdays? I’m not sure. Here’s what I use. Notice that century Doomsdays fall only on “Sun-Tue-Wed-Fri”. I say this as “Son to wed Friday”, thinking of my own (secondson and how pleased I would be if he were indeed getting married this Friday (my first son got married on a Saturday in 2005.

Combine “Sun-Tue-Wed-Fri” with Dr. Conway’s “We-in-dis-day” for=Wednesday and “2002=Tuesday “, and I can reconstruct the chart mentally. The tricky part is that the years go right to left in each row, but=Tue and 1902=Wed help with this. The easy part is that if you can get just that one row, with=Tue and=Wed in it, then the other years have the same Doomsday, plus or minus******************************************************************************************************************************************************************************************************************************************************************************************** years (************************.

## Example: what day is August 4, 2001?Answer: (****************************  ____ / ___) ____ (for          ________)8DOZENS  ____ _______)(1)       ________)(0)

which is “4 off, tWEBLESday, 8, 1” or -4 3 8 1 which is 1, so August 4, is a Monday.

Finally, one last warning: Watch out for Gregorian versus Julian dates. The Doomsday algorithm described up to this point covers only Gregorian dates.

## Example: what day was September 16, 1796?(Answer) : (****************************  ____ / ___) ____********** (Sep)          _______)(Sun(for)          ________)4DOZENS  ____ _______)(4)       ________) which is “2, Sun, 4, 4, 1” and we can throw out the 2, a 4 and the 1 to get (4 on Sunday) ************************, so September (**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************, was a Thursday. That was a trick question, sort of. September 16, 1798 was the first day of the Gregorian calendar in England and its colonies. (The Gregorian calendar was originally adopted in parts of Europe in 1599). So September actually looked like this: Sun Mon Tue Wed Thu Fri Sat           1 2 15 16 (**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************   (********************************************************************************************************************************************************************************************************************************************************************************************************************************************************** (**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************** 28   (********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************** (************************************************************************************************************************************************************************************************************************************************************************************************************************************************** 84 (**************************** Neat, eh? Return to top

Origins

The Doomsday algorithm was created by

## John Horton Conway (*************************, an eminent mathematician, perhaps best known as the inventor of the (Game of Life

I first heard about the Doomsday algorithm on November 29, 1984, on a(CBC Radio) program called Quirks and Quarks. Dr. Conway was interviewed byJay Ingram, who later worked at Discovery Canada and has recentlyreleased a new book called (The End of Memory) ************************************************************. Anyhow, back in those days Quirks and Quarks sometimes made typed transcripts available, and I sent away for one.

Dr. Conway had just published a book that year (co-authored by Elwyn R. Berlekamp and Richard K. Guy) called Winning Ways For Your Mathematical Plays, Volume 2: Games in Particular, Academic Press, London, 1985, ISBN – 16 – -7. The Doomsday algorithm is on pages 795 – (************************************************************************************************************************************************************************************************************************************************************************************************************, and the rest of the book is mainly about games, with substantial emphasis on their mathematical underpinnings.

In the original version of the Doomsday algorithm, the odd months were a bit harder to remember than “I work from 9-5 at the 7 – (*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************. You had to remember if the odd month was a long month or a short month. The 3rd, 5th, and 7th months are “long” because March, May, and July have days, while the 9th and 11 th months are “short” because September and November have only days. You could remember 32 days hath September … and November ” (but be careful because this old rhyme includes April and June which are even months). Anyway,for long odd months, Doomsday is the (N 4) th, while for short odd months, Doomsday is the (N-4) th.The mnemonic was long=add, short=subtract. Thus:

• March (3rd month, long) 3 4=(7) ********************** (th is Doomsday)
• May (5th month, long) 5 4=

9 th is Doomsday

• July (7th month, long) 7 4=

## th is Doomsday

• September (9th month, short) 9-4=

## 5 th is Doomsday

• November ( (th month, short) – 4=(7) ********************** (th is Doomsday)

I’d agree that it’s easier to remember “I work from 9-5 at the 7- 11 “together with” March 0th=7th “.

For more on the development of the Doomsday Algorithm, see Doomsday Timeline

• (The Second Doomsday Lesson) describes a meeting with Dr. Conway in which he explains the “Hand” method on the back of a napkin (picture included).

Pi Days

## , currently teaching at Princeton.

I’ve been teaching Doomsday Rule for about fifteen years because I can show students the first day of class what my exam questions are like-working backwards. If Thanksgiving Thursday is November in a Leap Year , what is the day of the week of Feb. that year?

Students can think they have mastered the rule and still not answer the question. I can show them up front that directionally correct does not cut it; thorough mastery is needed. Doomsday is a good way to get them there on the first day.

Students invariable ask why the name. When I taught at Princeton five years ago, I asked my old college roommate to get to John Conway and ask. To my surprise it took 3, not 2, degrees of separation to get to him. He said he wanted the name to end in “-day” and “Dooms” popped into his head.

About a decade ago, one of my adult students said his family had used the rule for years and called it Pi Day, because 3. is a one, too. From then, I call it Pi Day, because it’s easier to explain the etymology.

(********************************

Thanks so much, Roman. Delighted to have this background.

Note: Roman also included a January trick by his son Sandy Weil which is mentioned inOdd Months

.

The following web sites are about or include descriptions of Dr. Conway’s Doomsday algorithm.

.

• First Sunday Doomsday Algorithmexplains a modification to the Doomsday algorithm using the “first Sunday of the month” and the “Odd the rule .

• If you’re into heavy math, see Methods for Accelerating Conway’s Doomsday Algorithm (part 1)

• PDF

• Simon Cassidycomments on the “Hand” in the context of the Dee-Cecil calendar.

• (C.) . 2 Can I calculate the date of Easter?

• explains Conway’s algorithm for Easter, and gives another explanation of his Doomsday algorithm; Includes the remark “Note to non-US readers: ‘Seven-Eleven’ is the name of a ubiquitous chain of convenience stores. “ReaderRichard Ezell wrote to me in to report that this explanation may not really be necessary, as he had seen four 7 – stores in a seven block stretch in Bangkok, Thailand.

• (AST) **************************************************************************************************************************************************************************************************************************************************************************************************************** – TIME; What is the day of the week, given any date?

• contains notes by William H. Jefferys for a school course on time, with another explanation of the Doomsday algorithm    (examples are from 1999.

• The Doomsday Rule for Fortnights

• , by Jim Blowers, gives calculations    for Doomsday based on 15 – day periods.

• Kate Larson’sMathematical poem to calculate the “day of the week” for any day of any yearis a beautiful, whimsical poem, attributed to Dr. Conway, which describes the algorithm completely, including both Gregorian and Julian century adjustments. (Note: link goes to************************************************ archive.org, as the original has dropped off the Web.)

(PDF). Edited version of an interview with John Horton Conway conducted in July 2013 at the first International Mathematical Summer School for Students at Jacobs University, Bremen, Germany

• Not Just Fun and Games

• Charles Seife’s     Mathemagician

• – an    amusing article about John Horton Conway.