In the process of looking up John Conway’s “Doomsday Algorithm” for figuring out what day of the week “any” date falls on, I came across Chamberlain Fong’s description of a simplification of Conway’s algorithm that he and Michael Walters came up with, which they describe in a paper on arxiv. (“Any” is in quotes for reasons explained in Part 2.)
What does the Fong/Walters algorithm do differently? Let’s note what’s the same. Conway’s scheme of “Doomsdays” is still in place, and you still need to know the Doomsday for the start of the century. The difference is in computing the offset. There is no dividing by 12, remembering the quotient, dividing the remainder by 4, etc. (Apparently that part of the method was due to Lewis Carroll, as explained in Part 2 or in Fong’s Scientific American blog post.)
How does the alternate method , which they call “odd+11” work? If you love flowcharts, look here. But it’s pretty simple:
- Take the last two digits of the year.
- Is it odd? If so, add 11.
- Divide your number (which now must be even) by 2.
- Is your new number odd? If so, add 11 again.
- Reduce your number modulo 7.
- Subtract your number from 7 (“take the 7s complement”).