Lewis Carroll – computing the day of the week for any given date (1887)
Mental algorithms for calculating the day of the week from any date, including Lewis Carroll’s 1887 method and John Conway’s Doomsday rule, are compared and refined, with readers sharing mnemonic tables, shortcuts, and Python implementations. Contributors examine edge cases such as leap years, pre‑1900 dates, and the irregular adoption of the Gregorian calendar, highlighting how historical quirks like England’s 1752 calendar reform and the UK tax year’s April 6 start complicate seemingly simple formulas. Several argue that clear notation and clever mnemonics make these methods practical—both as a mental gymnastic and as a way to quickly answer “what day was that?” without a calendar.
Mental day-of-week algorithms
- Several commenters discuss mental methods to compute day-of-week in ~10–20 seconds using small lookup tables (“magic month numbers”) and addition mod 7.
- One widely used variant:
- Take years since a base year (e.g., 1900 or 2012).
- Add number of leap years since that base.
- Add a month-specific “magic number”.
- Add the day, reduce mod 7, map to weekday.
- Conway’s Doomsday rule is compared; some find it faster for dates in the current year but harder across years.
- Others propose tweaks for the year term (e.g., decade-based tricks, “odd+11” rule) to keep mental numbers small.
Month-number rules and confusion
- Multiple people struggle with Lewis Carroll’s textual rule for month items, especially the “begins or ends with a vowel” part.
- Some reverse-engineer that each month’s value is derived from the previous month’s item plus its days, mod 7, with shortcut rules for certain months.
- Several conclude it’s easier to memorize the final month table than to rely on Carroll’s prose.
Leap years and calendar quirks
- Handling leap years correctly (including century/400-year rules) is discussed; special adjustments are needed for January/February in leap years.
- There is concern about dates around calendar transitions (e.g., 1752 in the British Empire, differing adoption years globally).
- One code example for day-of-week acknowledges it is inaccurate around country-specific Julian→Gregorian transition dates.
Historical calendars and notation
- Commenters recall pre-1752 English “Old Style” new year starting March 25, Roman March-based years, and month-name origins.
- Tools like
cal 1752and the odd UK tax-year start are cited as lingering artifacts. - Broader point: messy notation (in math or chess history) makes otherwise simple ideas hard to use; better notation radically simplifies reasoning.
Usefulness, meta, and side topics
- Some see this skill as practically useful and mentally fun; others say its main value is as a party trick.
- There is brief mention of discomfort with celebrating certain historical figures, and a question whether an LLM could devise a novel algorithm for this task.