Loading...
Loading...
Number Theory · Axiom Academy
REAL WORLD Day of the Week Calculator Use modular arithmetic to instantly determine what day any date falls on Imagine you're planning a surprise birthday party for a friend born on July 4, 1995. You want to know: What day of the week were they born on? Was it a Monday? A Saturday? You could look it up online, but what if you're in a conversation and want to impress someone with your mental math skills? What if you're a historian trying to verify dates, or a programmer building a calendar app? The amazing thing is: you can calculate this in your head using modular arithmetic! Let's discover how mathematicians and calendar experts do it. Zeller's Congruence: The Secret Formula In 1882, Christian Zeller developed a brilliant formula that calculates the day of the week for any date in the Gregorian calendar. It's based entirely on modular arithmetic - the same concept we use with clock arithmetic! Let's break down what each variable means: The ⌊ ⌋ symbols mean "floor" - round down to the nearest integer. And everything is computed modulo 7 because there are 7 days in a week! Now let's use Zeller's formula to find what day of the week July 4, 1995 was. We'll go through each step of the calculation. According to Zeller's formula, h = 3. What day of the week is this? Remember: 0 = Saturday, 1 = Sunday, 2 = Monday, 3 = Tuesday, 4 = Wednesday, 5 = Thursday, 6 = Friday Zeller's congruence works because it accounts for all the calendar irregularities:
This is the written version of the interactive lesson above. See the full Number Theory course.