Remix.run Logo
Gauss's Weekday Algorithm, Visualized(lukasmetzner.github.io)
44 points by lukasmetzner 5 days ago | 7 comments
userbinator 8 hours ago | parent | next [-]

This is simply the fact that 365 % 7 == 1, with leap year adjustments.

kmm 2 hours ago | parent [-]

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.

mschnell 7 hours ago | parent | prev | next [-]

I see only colored text, where is the visualization?

wolfi1 5 hours ago | parent [-]

Imust admit I expected more, too.

wolfi1 5 hours ago | parent | prev | next [-]

as Easter is nearing the Gaussian compute algorithm deserves some attention,too

IncreasePosts 7 hours ago | parent | prev [-]

With this plus the Doomsday algorithm, I am invincible.

seanhunter 4 hours ago | parent [-]

For people who don’t know, John H. Conway’s doomsday algorithm allows you to compute the day of the week for any date by starting from a set of memorable dates (called “doomsdays”) and working from there. https://en.wikipedia.org/wiki/Doomsday_rule

So for example doomsday for this year is a Saturday, so I know the last day in February is a Saturday (this Saturday in fact) and also that Independence Day, Boxing Day and Halloween are also going to be on Saturday this year, because they are all Doomsdays (on non-leap years).