Every now and then a prominent religious zealot proclaims that the end is nigh. Harold Camping is the most recent example of such a doomsayer. He declared that judgment day commenced on May 21, 2011, and he also predicted that the destruction of the universe would follow on October 21. Wouldn't it be nice to know which day of the week our universe would end? After all, if it were to fall on a Tuesday, why bother going to work that week?

It's easy to declare that October 21 is a Friday, and many people can tell you that May 21 was a Saturday—because those are relatively recent dates. The real challenge is to determine the day of the week for an arbitrary date in history. One need not look very far for an arbitrary apocalyptic date.

In a book titled 1994?, Camping predicted that September 6, 1994, would be the end of days. Of course, that day came and went without incident. But what day of the week was it? While we're at it, why don't we raise the stakes further by rolling back the calendar a couple centuries: What day of the week was September 6, 1752, in England and its American colonies?

Algorithms in Wonderland
When he was not writing literary works like Alice's Adventures in Wonderland, Lewis Carroll dabbled in mathematics. One of the results of his diversion was an 1887 perpetual calendar algorithm for calculating the day of the week for a given date. Many calendar algorithms preceded Carroll's. In fact, the great mathematician Karl Friedrich Gauss had his own version in 1800. But Carroll was the first person to devise an algorithm suitable for mental calculation. Carroll himself could perform his calendar algorithm in his head, calculating the day of the week for a given date in about 20 seconds.

Many years later longtime Scientific American columnist Martin Gardner read about Carroll's calendar algorithm. (In addition to writing his popular "Mathematical Games" column, Gardner was a serious Carroll scholar.) Gardner then told his friend, John Horton Conway, about Carroll's algorithm and challenged Conway to come up with a simpler one. Conway, being a world-class mathematician, did come up with a much simpler algorithm in 1973. He called his algorithm the "doomsday rule."

The doomsday rule is now more commonly known as the doomsday algorithm. The algorithm is simple and only involves basic arithmetic. Moreover, it requires very little memorization. With practice, it can done mentally without paper and pencil in just a few seconds. In a 1999 profile of Conway, Scientific American's Mark Alpert wrote that Conway's computer was programmed to quiz him with random dates; he could usually come up with the answer in less than two seconds.

The end is not nigh
Despite its usefulness in retracing failed predictions by Camping and other prognosticators of end times, the doomsday algorithm has nothing to do with the apocalypse. Conway named his calendar algorithm after discovering an interesting property of a certain day of the week in a given year, which he called "doomsday." But his use of "doomsday" is probably a misnomer. One could just as easily refer to it as "anchor day."

The idea that makes the doomsday algorithm tick is that certain memorizable dates always share the same day of the week within any given year. For example, April 4, June 6, August 8, October 10 and December 12 all fall on a Monday in 2011. Moreover, you can check on a calendar that these dates all fall on the same day of the week in any year. For instance, in 1994 they were all Mondays, too. Conway used this fact as the basis for his algorithm. This special day of the week, shared by 4/4, 6/6, 8/8, 10/10 and 12/12, is the anchor day. (Which day of the week anchor day falls on varies from year to year.)

Other memorizable dates also fall on a given year's anchor day: 5/9, 9/5, 7/11 and 11/7 are all Mondays in 1994 and 2011. Just as 4/4, 6/6, 8/8, 10/10 and 12/12 are easy to remember because of repeating digits, one can easily remember the four additional dates using Conway's simple mnemonic: "Working 9 to 5 at the 7–Eleven." Armed with these memorizable anchor dates, one can easily determine the day of the week for nearby dates. (There are other tricks to assist with dates in the first months of the year—for example, the last day of February is always an anchor day, leap year or no.) For instance, since we already know that 9/5 was a Monday in 1994, it is easy to deduce that September 6, 1994—Harold Camping's no-show apocalypse—was a Tuesday. The use of a nearby anchor is the key to the doomsday algorithm.

The drifting anchor
The day of the week drifts annually for a given date. October 21, 2010, was a Thursday. October 21, 2011, will be a Friday and—assuming that the world does not really end that day—in 2012 October 21 will be a Sunday and October 21, 2013, will be a Monday. There must be a pattern here. Indeed, the day of the week for a given date progresses by one annually, except on leap years, where it progresses by two. Moreover, there is a simple mathematical formula for measuring the cumulative annual drift of the day of the week from the start of the century. Although the formula is simple, it is difficult to solve without pencil and paper. Lewis Carroll discovered an alternative formula for this calculation in 1887, which looks more complex but is actually more suitable for mental calculation. In fact, Conway reused Carroll's method as part of the doomsday algorithm.

Last year Michael K. Walters of the Air Force Institute of Technology and I came up with a different way of calculating the cumulative drift of the day of the week. We believe that our method is easier to perform mentally than Carroll's, because our method requires fewer divisions and memorizations. We call our method the Odd+11 method. A summary of our method is available as a flowchart here.

So what day of the week did September 6, 1752, fall on? To answer that question, one needs to know a bit of history on our current calendar system. Earth spins around its axis approximately 365.24219 times annually. This rate is known as the mean tropical year. The true number of days in the mean tropical year actually varies slightly over time. Our modern calendar system of 12 months started with the Julian calendar circa 45 B.C. The Julian calendar approximated the mean tropical year as 365.25 days and proposed 366-day leap years for every one divisible by four. This approximation made the Julian calendar fairly accurate in tracking the annual seasons for several centuries. But eventually the approximation errors accumulated. By 1582 the Julian calendar was out of sync with the seasons by several days. Pope Gregory XIII mandated a reform to the calendar; his Gregorian calendar approximated the mean tropical year as 365.2425 days. The pope thereby amended the rule for determining leap years: A year divisible by 100 is only a leap year if it is also divisible by 400. For example, the year 2000 was a leap year, but the year 1900 was not, because when divided by 400, it does not render a whole number.

The Gregorian calendar was not widely adopted across the world until much later. In fact, the British Empire and its colonies did not use the updated calendar system until 1752. By then the Julian calendar was out of sync with the seasons by 11 days. In order to synchronize with the Gregorian calendar, it was mandated that Wednesday, September 2, 1752, be followed by Thursday, September 14, 1752. Hence, the date September 6, 1752, does not exist in British and American history! A nonexistent date certainly does not have a day of the week. If you think that daylight saving time is confusing, try skipping days on for size.