3 ms·
Unless you're considering a limited date range, it should fall equally often on both in the limit since neither 365 nor 366 (leap year) are multiples of 7.
by tromp 2y ago
Unless you're considering a limited date range, it should fall equally often on both in the limit since neither 365 nor 366 (leap year) are multiples of 7.
- deleted 2y ago[deleted]
- madcaptenor 2y agoSo you’d think that, and it is approximately true. But the calendar repeats every 400 years (there are 97 leap years in 400, and 497 is a multiple of 7). And 400 isn’t a multiple of 7, so you can’t have it work out exactly.
- tromp 2y agoBut if the pair of (date, weekday) repeats every 400*7 years, then it still works out exactly?!
- bumbledraven 2y agoIn the Gregorian calendar, January 1 falls on a Saturday in any year that is a multiple of 400. (This follows from any correct day-of-the-week algorithm, such as https://firstsundaydoomsday.blogspot.com/2009/12/quick-start-guide.html https://firstsundaydoomsday.blogspot.com/2009/12/quick-start....) Since each 400-year cycle begins on the same day, rather than balancing out, any imbalances would actually accumulate. To check, see this 5-line brute-force calculation in JavaScript: https://news.ycombinator.com/item?id=42024474 https://news.ycombinator.com/item?id=42024474
- tromp 2y agoAh, the number of days in 400 years is 400 * 365 + 97 = (57*7+1) * (52*7+1) + (14*7-1) = 0 mod 7, so indeed it doesn't work out.
- madcaptenor 2y agoExactly.