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:
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:
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.
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.
1900s = Wednesday = 3.
Y = 69
A = floor(69 รท 12) = 5
B = 69 modulo 12 = 9
C = floor(9 รท 4) = 2.
3 + 5 + 9 + 2 = 19
19 modulo 7 = 5
Weekday 5 = Friday.
July 11, 1969 was Friday.
July 20 is 9 days later.
Friday + 9 days = Sunday.
Step 5: Remember leap years
A Gregorian leap year:
- Must be divisible by 4.
- Except years divisible by 100 are not leap years.
- Unless the year is also divisible by 400.
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
Accuracy: 0%
YOUR FIRST CHALLENGE
๐ฎ Guess the Weekday
Use the Doomsday Algorithm to calculate the weekday of this date.
Choose your answer to begin.