Does anyone know why this works? Conway's algorithms aren't making much sense to me, and the wikipedia page doesn't offer much explanation. Besides his calculations, one thing I'm having trouble with is this:
It takes advantage of the fact that within any calendar year, the days of 4/4, 6/6, 8/8, 10/10, 12/12, and the last day of February always occur on the same day of the week—the so-called "doomsday" (and furthermore that other months have "doomsday" on the pairs 5/9 and 9/5 as well as 7/11 and 11/7
This is true--In 2010, all those listed days were a Sunday, and wikipedia says that January 3rd and the last day of non-leap year Februarys are the doomsday...But how is that true? How does that just happen to line up?
And why do you need an "anchor" day?
I've copied some of the math below, if anyone's interested:
1. Divide the year's last two digits (call this y) by 12 and let a be the floor of the quotient.
2. Let b be the remainder of the same quotient.
3. Divide that remainder by 4 and let c be the floor of the quotient.
4. 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.)
5. Count forward the specified number of days (d or the remainder of d/7) from the anchor day to get the year's Doomsday.
And an easier method to get the Doomsday is [imath](y + \lfloor y/4 \rfloor) \bmod 7 + anchor day[/imath], where y is the last two digits of the year.