This algorithm for mental calculation was devised by John Conway[1][2] after drawing inspiration from Lewis Carroll's work on a perpetual calendar algorithm.[3][4] It takes advantage of each year having a certain day of the week (the doomsday) upon which certain easy-to-remember dates fall; for example, 4/4, 6/6, 8/8, 10/10, 12/12, and the last day of February all occur on the same day of the week in any given year. Applying the Doomsday algorithm involves three steps:

Determine the "anchor day" for the century.

Use the anchor day for the century to calculate the doomsday for the year.

Choose the closest date out of the ones that always fall on the doomsday (e.g. 4/4, 6/6, 8/8), and count the number of days (modulo 7) between that date and the date in question to arrive at the day of the week.

Since this algorithm involves treating days of the week like numbers modulo 7, John Conway suggests thinking of the days of the week as "Noneday" or "Sansday" (for Sunday), "Oneday", "Twosday", "Treblesday", "Foursday", "Fiveday", and "Six-a-day".

The algorithm is simple enough for anyone with basic arithmetic ability to do the calculations mentally. Conway can usually give the correct answer in under two seconds. To improve his speed, he practices his calendrical calculations on his computer, which is programmed to quiz him with random dates every time he logs on.[5]

Doomsday for the current year in the Gregorian calendar (2015) is Saturday.

For some other contemporary years :

Doomsdays for the Gregorian calendar

Mon.

Tue.

Wed.

Thu.

Fri.

Sat.

Sun.

Mon.

Tue.

Wed.

Thu.

Fri.

Sat.

Sun.

1898

1899

1900

1901

1902

1903

→

1904

1905

1906

1907

→

1908

1909

1910

1911

→

1912

1913

1914

1915

→

1916

1917

1918

1919

→

1920

1921

1922

1923

→

1924

1925

1926

1927

→

1928

1929

1930

1931

→

1932

1933

1934

1935

→

1936

1937

1938

1939

→

1940

1941

1942

1943

→

1944

1945

1946

1947

→

1948

1949

1950

1951

→

1952

1953

1954

1955

→

1956

1957

1958

1959

→

1960

1961

1962

1963

→

1964

1965

1966

1967

→

1968

1969

1970

1971

→

1972

1973

1974

1975

→

1976

1977

1978

1979

→

1980

1981

1982

1983

→

1984

1985

1986

1987

→

1988

1989

1990

1991

→

1992

1993

1994

1995

→

1996

1997

1998

1999

→

2000

2001

2002

2003

→

2004

2005

2006

2007

→

2008

2009

2010

2011

→

2012

2013

2014

2015

→

2016

2017

2018

2019

→

2020

2021

2022

2023

→

2024

2025

2026

2027

→

2028

2029

2030

2031

→

2032

2033

2034

2035

→

2036

2037

2038

2039

→

2040

2041

2042

2043

→

2044

2045

2046

2047

→

2048

2049

2050

2051

→

2052

2053

2054

2055

→

2056

2057

2058

2059

→

2060

2061

2062

2063

→

2064

2065

2066

2067

→

2068

2069

2070

2071

→

2072

2073

2074

2075

→

2076

2077

2078

2079

→

2080

2081

2082

2083

→

2084

2085

2086

2087

→

2088

2089

2090

2091

→

2092

2093

2094

2095

→

2096

2097

2098

2099

2100

Notes: Fill in the table horizontally, skipping one column for each leap year. This table cycles every 28 years, except in the Gregorian calendar on years multiple of 100 (like 1900 which is not a leap year) that are not multiple of 400 (like 2000 which is still a leap year). The full cycle is 28 years (1,461 weeks) in the Julian calendar, 400 years (20,871 weeks) in the Gregorian calendar.

One can easily 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.

As mentioned above, the last day of February always falls on the doomsday, as do the double dates 4/4, 6/6, 8/8, 10/10, and 12/12. Four of the odd month dates (May 9, September 5, July 11, and November 7) can be remembered with the mnemonic "I work from 9 to 5 at the 7–11." For March, one can remember the pseudo-date "March 0", which refers to the day before March 1, i.e. the last day of February; one can alternately remember the date a week later, March 7, or March 21 which is traditionally regarded as the first day of spring in the northern hemisphere and autumn in the southern hemisphere (although after 2007 the Northward equinox will not fall on that date in Europe again until 2102).[6] 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".

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.

To find which day of the week Christmas Day of 2006 was: in the year 2006, Doomsday was Tuesday. Since December 12 is a Doomsday, December 25, being thirteen days afterwards (two weeks less a day), fell on a Monday.

It is useful to note that Christmas Day is always the day before Doomsday ("One off Doomsday"). In addition, July 4 is always on a Doomsday, as is Halloween (October 31).

To find the day of week that the September 11, 2001 attacks on the World Trade Center occurred: the century anchor was Tuesday, and Doomsday for 2001 is one day beyond, which is Wednesday. September 5 was a Doomsday, and September 11, six days later, fell on a Tuesday.

We first take the anchor day for the century. For the purposes of the Doomsday rule, a century starts with '00 and ends with '99. The following table shows the anchor day of centuries 1800–1899, 1900–1999, 2000–2099 and 2100–2199.

Next, we find the year's Doomsday. To accomplish that according to Conway:

Divide the year's last two digits (call this y) by 12 and let a be the floor of the quotient.

Let b be the remainder of the same quotient.

Divide that remainder by 4 and let c be the floor of the quotient.

Let d be the sum of the three numbers (d = a + b + c). (It is again possible here to divide by seven and take the remainder. This number is equivalent, as it must be, to the sum of the last two digits of the year taken collectively plus the floor of those collective digits divided by four.)

Count forward the specified number of days (d or the remainder of d/7) from the anchor day to get the year's Doomsday.

The doomsday calculation is effectively calculating the number of days between any given date in the base year and the same date in the current year, then taking the remainder modulo 7. When both dates come after the leap day (if any), the difference is just 365y plus y/4 (rounded down). But 365 equals 52*7+1, so after taking the remainder we get just

This gives a simpler formula if one is comfortable dividing large values of y by both 4 and 7. For example, we can compute , which gives the same answer as in the example above.

Where 12 comes in is that the pattern of almost repeats every 12 years. After 12 years, we get (12 + 12/4) mod 7 = 15 mod 7 = 1. If we replace y by y mod 12, we are throwing this extra day away; but adding back in compensates for this error, giving the final formula.

A simpler method for finding the year's doomsday was discovered in 2010 by Chamberlain Fong and Michael K. Walters,[7] and described in their paper submitted to the 7th International Congress on Industrial and Applied Mathematics (2011). Called the Odd+11 method, it has been proven[7] equivalent to computing

It is well suited to mental calculation, because it requires no division by 4 (or 12), and the procedure is easy to remember because of its repeated use of the "odd+11" rule.

Extending this to get the Doomsday, the procedure is often described as accumulating a running total T in six steps, as follows:

Let T be the year's last two digits.

If T is odd, add 11.

Now let T = T/2.

If T is odd, add 11.

Now let T = 7 − (T mod 7).

Count forward T days from the century's anchor day to get the year's Doomsday.

Applying this method to the year 2005, for example, the steps as outlined would be:

T = 5

T = 5+11 = 16 (Added 11 because T is odd)

T = 16/2 = 8

T = 8 (Do nothing since T is even.)

T = 7 − (8 mod 7) = 7 − 1 = 6

Doomsday for 2005 = 6 + Tuesday = Monday

The explicit formula for the odd+11 method is:

Although this expression looks daunting and complicated, it is actually simple[7] because of a common subexpression that only needs to be calculated once.

* In leap years the nth Doomsday is in ISO weekn. In common years the day after the nth Doomsday is in week n. Thus in a common year the week number on the Doomsday itself is one less if it is a Sunday, i.e., in a common year starting on Friday.

Since in the Gregorian calendar there are 146097 days, or exactly 20871 seven-day weeks, in 400 years, the anchor day repeats every four centuries. For example, the anchor day of 1700–1799 is the same as the anchor day of 2100–2199, i.e. Sunday.

The full 400-year cycle of Doomsdays is given in the table to the right. The centuries are for the Gregorian and proleptic Gregorian calendar, unless marked with a J for Julian. The Gregorian leap years are highlighted.

Negative years use astronomical year numbering. Year 25BC is −24, shown in the column of −100J (proleptic Julian) or −100 (proleptic Gregorian), at the row 76.

Frequency of Gregorian Doomsday in the 400-year cycle per weekday and year type

Sunday

Monday

Tuesday

Wednesday

Thursday

Friday

Saturday

Total

Non-leap years

43

43

43

43

44

43

44

303

Leap years

13

15

13

15

13

14

14

97

Total

56

58

56

58

57

57

58

400

A leap year with Monday as Doomsday means that Sunday is one of 97 days skipped in the 497-day sequence. Thus the total number of years with Sunday as Doomsday is 71 minus the number of leap years with Monday as Doomsday, etc. Since Monday as Doomsday is skipped across 29 February 2000 and the pattern of leap days is symmetric about that leap day, the frequencies of Doomsdays per weekday (adding common and leap years) are symmetric about Monday. The frequencies of Doomsdays of leap years per weekday are symmetric about the Doomsday of 2000, Tuesday.

The frequency of a particular date being on a particular weekday can easily be derived from the above (for a date from 1 January – 28 February, relate it to the Doomsday of the previous year).

For example, 28 February is one day after Doomsday of the previous year, so it is 58 times each on Tuesday, Thursday and Sunday, etc. 29 February is Doomsday of a leap year, so it is 15 times each on Monday and Wednesday, etc.

Regarding the frequency of Doomsdays in a Julian 28-year cycle, there are 1 leap year and 3 common years for every weekday, the latter 6, 17 and 23 years after the former (so with intervals of 6, 11, 6, and 5 years; not evenly distributed because after 12 years the day is skipped in the sequence of Doomsdays).[citation needed] The same cycle applies for any given date from 1 March falling on a particular weekday.

For any given date up to 28 February falling on a particular weekday, the 3 common years are 5, 11, and 22 years after the leap year, so with intervals of 5, 6, 11, and 6 years. Thus the cycle is the same, but with the 5-year interval after instead of before the leap year.

Thus, for any date except 29 February, the intervals between common years falling on a particular weekday are 6, 11, 11. See e.g. at the bottom of the page Common year starting on Monday the years in the range 1906–2091.

For 29 February falling on a particular weekday, there is just one in every 28 years, and it is of course a leap year.

The Gregorian calendar accurately lines up with astronomical events such as solstices. In 1582 this modification of the Julian calendar was first instituted. In order to correct for calendar drift, 10 days were skipped, so Doomsday moved back 10 days (i.e. 3 days): Thursday 4 October (Julian, Doomsday is Wednesday) was followed by Friday 15 October (Gregorian, Doomsday is Sunday). The table includes Julian calendar years, but the algorithm is for the Gregorian and proleptic Gregorian calendar only.

Note that the Gregorian calendar was not adopted simultaneously in all countries, so for many centuries, different regions used different dates for the same day.

Suppose you want to know the day of the week of September 18, 1985. You begin with the century's anchor day, Wednesday. To this, we'll add three things, called a, b, and c above:

a is the floor of 85/12, which is 7.

b is 85 mod 12, which is 1.

c is the floor of b/4, which is 0.

This yields 8. In modulo 7 arithmetic, 8 is congruent to 1. Because the century's anchor day is Wednesday (index 3), and 3 + 1 = 4, Doomsday in 1985 was Thursday (index 4). We now compare September 18 to a nearby Doomsday, September 5. We see that the 18th is 13 past a Doomsday. In modulo 7 arithmetic, 13 is congruent to 6 or, more succinctly, −1. Thus, we take one away from the Doomsday, Thursday, to find that September 18, 1985 was a Wednesday.

Suppose that you want to find the day of week that the American Civil War broke out at Fort Sumter, which was April 12, 1861. The anchor day for the century was 99 days after Thursday, or, in other words, Friday (calculated as (18+1)*5+floor(18/4); or just look at the chart, above, which lists the century's anchor days). The digits 61 gave a displacement of six days so Doomsday was Thursday. Therefore, April 4 was Thursday so April 12, eight days later, was a Friday.