logoalt Hacker News

kmmtoday at 10:24 AM0 repliesview on HN

That's correct, but it's pretty well-hidden because at first sight there is no term that's just the year modulo 7. That's because a Gregorian calendar cycle of 400 years is coincidentally an integer amount of weeks long, so after the term modulo 400 you don't need another correction anymore.

To recover the fact that 365 % 7 == 1 from the given formula, one can notice that the sum of the coefficients 5+4+6=15, which modulo 7 is 1.