Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

In Summer Wars the main character (he is a mathematician) calculates the day of the week of someone's birthday (19/07/1992 is Sunday). I know (very) basic modular arithmetic but I can't figure out how to do it. Can someone point me to the right direction? It seems fun to do.

share|improve this question
en.wikipedia.org/wiki/Doomsday_rule –  t.b. Jan 10 '11 at 3:56
I actually teach this algorithm in my algorithms class; it's useful in real life to be able to do this! –  Fixee Apr 20 '11 at 3:54
Dershowitz/Reingold is the go-to book for topics like these. –  Guess who it is. Apr 20 '11 at 4:56
I wonder if O’Beirne’s algorithm (sixthform.info/maths/?p=155) to find the date of Easter Sunday is based (at least partialy) on this one. –  Américo Tavares May 12 '11 at 23:39

3 Answers 3

up vote 2 down vote accepted

The Zeller congruence is yet another method for reckoning the day of the week of a given date. Kim Larsen presents an implementation of a variant of the Zeller congruence in this article. (There is additional discussion of Larsen's formulation here.)

share|improve this answer

I believe that this website is the easiest and fastest way to learn this.


share|improve this answer

Before the Doomsday method (see link in Theo Buehler's comment), there was a formula due to Gauss. A good write-up is Berndt Schwerdtfeger, Gauss' calendar formula for the day of the week, available at http://berndt-schwerdtfeger.de/cal/cal.pdf

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.