Doomsday rule


The Doomsday rule, Doomsday algorithm or Doomsday method is an algorithm of determination of the day of the week for a given date. It provides a perpetual calendar because the Gregorian calendar moves in cycles of 400 years. The algorithm for mental calculation was devised by John Conway in 1973, drawing inspiration from Lewis Carroll's perpetual calendar algorithm. It takes advantage of each year having a certain day of the week upon which certain easy-to-remember dates, called the doomsdays, fall; for example, the last day of February, April 4, June 6, August 8, October 10, and December 12 all occur on the same day of the week in the year.
Applying the Doomsday algorithm involves three steps: determination of the anchor day for the century, calculation of the anchor day for the year from the one for the century, and selection of the closest date out of those that always fall on the doomsday, e.g., 4/4 and 6/6, and count of the number of days between that date and the date in question to arrive at the day of the week. The technique applies to both the Gregorian calendar and the Julian calendar, although their doomsdays are usually different days of the week.
The algorithm is simple enough that it can be computed mentally. Conway could usually give the correct answer in under two seconds. To improve his speed, he practiced his calendrical calculations on his computer, which was programmed to quiz him with random dates every time he logged on.

Doomsdays for contemporary years

Doomsday for the current year in the Gregorian calendar is. Simple methods for [|finding the doomsday of a year] exist.
SunMonTueWedThuFriSat
179617971798179918001801
180218031804180518061807
18081809181018111812
181318141815181618171818
18191820182118221823
182418251826182718281829
183018311832183318341835
18361837183818391840
184118421843184418451846
18471848184918501851
185218531854185518561857
185818591860186118621863
18641865186618671868
186918701871187218731874
18751876187718781879
188018811882188318841885
188618871888188918901891
18921893189418951896
1897189818991900190119021903
19041905190619071908
190919101911191219131914
19151916191719181919
192019211922192319241925
192619271928192919301931
19321933193419351936
193719381939194019411942
19431944194519461947
194819491950195119521953
195419551956195719581959
19601961196219631964
196519661967196819691970
19711972197319741975
197619771978197919801981
198219831984198519861987
19881989199019911992
199319941995199619971998
19992000200120022003
200420052006200720082009
201020112012201320142015
20162017201820192020
202120222023202420252026
20272028202920302031
203220332034203520362037
203820392040204120422043
20442045204620472048
204920502051205220532054
20552056205720582059
206020612062206320642065
206620672068206920702071
20722073207420752076
207720782079208020812082
20832084208520862087
208820892090209120922093
209420952096209720982099
210021012102210321042105

Finding the day of the week from a year's doomsday

One can find the day of the week of a given calendar date by using a nearby doomsday as a reference point. To help with this, the following is a list of easy-to-remember dates for each month that always land on the doomsday.
The last day of February is always a doomsday. For January, January 3 is a doomsday during common years and January 4 a doomsday during leap years, which can be remembered as "the 3rd during 3 years in 4, and the 4th in the 4th year". For March, one can remember either Pi Day or "March 0", the latter referring to the day before March 1, i.e. the last day of February.
For the months April through December, the even numbered months are covered by the double dates 4/4, 6/6, 8/8, 10/10, and 12/12, all of which fall on the doomsday. The odd numbered months can be remembered with the mnemonic "I work from 9 to 5 at the 7–11", i.e., 9/5, 7/11, and also 5/9 and 11/7, are all doomsdays.
John Conway wrote that: "Summary: 'Last' in Jan and Feb, otherwise nth in even months, in odd ones".
He clarified that: "The sign is + for long odd months, and − for short ones ".
Several well-known dates, such as Independence Day in United States, Boxing Day, Halloween and Valentine's Day in common years, also fall on doomsdays every year.
Since the doomsday for a particular year is directly related to weekdays of dates in the period from March through February of the next year, common years and leap years have to be distinguished for January and February of the same year.

Example

To find which day of the week Christmas Day of 2027 is, proceed as follows: in the year 2027, doomsday is on Sunday. Since December 12 is a doomsday, December 25, being thirteen days afterwards, will fall on a Saturday. Christmas Day is always the day of the week before doomsday. In addition, July 4 is always on the same day of the week as a doomsday, as are Halloween, Pi Day, and December 26.

Mnemonic weekday names

Since this algorithm involves treating days of the week like numbers modulo 7, John Conway suggested thinking of the days of the week as "Noneday" or "Sansday", "Oneday", "Twosday", "Treblesday", "Foursday", "Fiveday", and "Six-a-day" to recall the number-weekday relation without needing to count them out in one's head.
Day of weekIndex
number
Mnemonic
Sunday0Noneday or
Sansday
Monday1Oneday
Tuesday2Twosday
Wednesday3Treblesday
Thursday4Foursday
Friday5Fiveday
Saturday6Six-a-day

There are some languages, such as Slavic languages, Chinese, Estonian, Greek, Portuguese, Galician and Hebrew, that base some of the names of the week days in their positional order. The Slavic, Chinese, and Estonian agree with the table above; the other languages mentioned count from Sunday as day one.