This algorithm for mental calculation was devised by John Conway after drawing inspiration from Lewis Carroll’s work on a perpetual calendar algorithm. It takes advantage of the fact that each year has a certain day of the week (the doomsday) upon which certain easy-to-remember dates fall; for example, 4/4, 6/6, 8/8, 10/10, 12/12, and the last day of February all occur on the same day of the week in any given year. Applying the Doomsday algorithm involves three steps:
- Determine the “anchor day” for the century.
- Use the anchor day for the century to calculate the doomsday for the year.
- Choose the closest date out of the ones that always fall on the doomsday (e.g. 4/4, 6/6, 8/8), and count the number of days (modulo 7) between that date and the date in question to arrive at the day of the week.