Question Regarding John Conway's Doomsday Algorithm I have been trying to understand the Doomsday Algorithm of John Conway which he uses to tell the day of a given date. I understand that there are various methods, but I started to learn the one he came up with. (I aim to learn other methods afterward.) He presents it in these two videos:
Video 1
Video2
Essentially, I have a question regarding the four-minute second video that shows how to find the Doomsday of a year.
Let's assume that I want to find the Doomsday of 1976. I know that for 1900, it was Wednesday. From 1900 to 1976, there are 6 dozens, then 4 years left, and 1 is a leap year. 6+4+1 = 11. 11 mod 7 is 4. Adding 4 to Wednesday, we reach Sunday.
I have no problems with this example. However, when I try another year, I can't calculate Doomsday correctly. Specifically, let's assume that I want to find the Doomsday of the year 2100. 2000 was a Tuesday. There are 8 dozens, 4 days years left, and 1 is a leap year. 8+4+1 = 13. 13 mod 7 is 6. Adding 6 to Tuesday, we reach Monday. However, the Doomsday for 2100 is Sunday. Can someone spot my mistake?
Thank you in advance
 A: I think you're getting in trouble because your formula assumes there's one leap year every 4 years, but actually 2100 is not a leap year. If you take away the "+1" that you added for "1 leap year" then you'll end up with Sunday instead of Monday which is the desired result.
Here's a Wikipedia link about leap years. TLDR the full rule is "any year that's divisible by 4, except not if it's a multiple of 100, except actually include it anyway if it's also a multiple of 400". Many people don't know the detailed rule because why would they? The last time it mattered was 1900 and it won't matter for another 78 years.
To make your version of the algorithm correct, you should subtract the number of "false positive leap years" in the interval $(1900, \text{target_year}]$. The reason for the half-open interval is that 1900's leap status doesn't impact the calculation and the target year's leap status does, since 4/4, 6/6, etc come after February.
Examples
For example, if computing the Doomsday of the year 2300, you'd need to subtract $3$ at the end, to account for the false positives 2100, 2200, 2300.
Another example: If you used 2080 as your base year and 2120 as your target year, you'd need to subtract 1 (accounting for the false positive 2100). When computing the correction term we should not focus on the length of the timespan (only 40 years in this case) but just on how many false positive years fall in the range.
Final example: Base year = 1900, target year = 3456. This time the correction term is $11$ days, accounting for these false positives: 2100, 2200, 2300, 2500, 2600, 2700, 2900, 3000, 3100, 3300, 3400.
