LEARN โ€ข PRACTICE โ€ข MASTER

Master the Calendar.

Learn a mathematical trick to calculate the weekday of almost any date without looking at a calendar.

๐Ÿง™โ€โ™‚๏ธ Lesson 1: The Doomsday Algorithm

The Doomsday Algorithm is a mental calculation method developed by mathematician John Conway. It helps you determine the weekday of a date using a few simple steps.

Step 1: Understand the Doomsday

Every year has one special weekday called its Doomsday. Certain memorable dates always land on that weekday within the same year.

Memorize these monthly anchor dates:

Jan 3Non-leap year
Jan 4Leap year
Feb 28Non-leap year
Feb 29Leap year
Mar 14March
Apr 4April
May 9May
Jun 6June
Jul 11July
Aug 8August
Sep 5September
Oct 10October
Nov 7November
Dec 12December

For example, if a year's Doomsday is Friday, July 11 and October 10 are Fridays too.

Step 2: Find the century anchor

The Gregorian calendar uses a repeating pattern of century anchor weekdays. For our 1900โ€“2100 challenge:

1900โ€“1999: Wednesday (3)
2000โ€“2099: Tuesday (2)
2100: Sunday (0)

Weekday numbers: Sunday = 0, Monday = 1, Tuesday = 2, Wednesday = 3, Thursday = 4, Friday = 5, Saturday = 6.

Step 3: Calculate the year's Doomsday

Take the last two digits of the year. Call this number Y.

Year calculation:
A = floor(Y รท 12)
B = Y modulo 12
C = floor(B รท 4)

Add A + B + C + the century anchor.
Divide the result by 7 and keep the remainder.

That remainder is the year's Doomsday weekday.

Step 4: Find your target date

Find the monthly anchor date, then count forward or backward to your target date. Each day changes the weekday by one, wrapping around after Saturday.

Worked Example: July 20, 1969

Let's calculate the weekday of the date humans first landed on the Moon.

1. Century anchor
1900s = Wednesday = 3.
2. Last two digits
Y = 69
A = floor(69 รท 12) = 5
B = 69 modulo 12 = 9
C = floor(9 รท 4) = 2.
3. Find the Doomsday
3 + 5 + 9 + 2 = 19
19 modulo 7 = 5
Weekday 5 = Friday.
4. Use July's anchor
July 11, 1969 was Friday.
July 20 is 9 days later.
Friday + 9 days = Sunday.
Final answer: July 20, 1969 was a Sunday!

Step 5: Remember leap years

A Gregorian leap year:

This is why 2000 was a leap year, but 1900 was not. The algorithm uses January 4 and February 29 as its anchors in leap years.

Ready to practice?

Now that you've learned the method, try calculating random dates between 1900 and 2100!

๐Ÿ† Your Progress

0 Correct
0 Attempts
0 Best streak

Accuracy: 0%

YOUR FIRST CHALLENGE

๐Ÿ”ฎ Guess the Weekday

Use the Doomsday Algorithm to calculate the weekday of this date.

Loading...

Choose your answer to begin.