How Rainman Computes Dates

Remember Dustin Hoffman’s character in the movie “Rainman,” who can instantly say the day of the week for a given date?  Of course, he was an autistic savant and probably didn’t know and certainly couldn’t teach how he does it, but here is a method I learned from my Dad.


Do all math mod 7, that is, you only need to keep the remainder of the results of any calculation after dividing by 7.  Thus, 15 is 1, 33 is 5, 49 is 0, etc.

Every day of the week has a number, starting with 1 for Sunday and ending with 0 for Saturday.  Your goal is to convert any Gregorian calendar date into such a number.

Jan and Feb belong to the year BEFORE. The reason is that leap years add a day at the end of Feb and it makes all the math easier to think that Jan and Feb 1963 are really part of 1962, for example.  Also remember that the Romans started their year with the month of March.  Maybe it was for a similar reason.


29 Nov 1872.

First convert the century.  1900 happens to be a 0, so that’s really really easy and convenient.  The numbers for all other centuries go in a cycle 6 4 2 0, which is also really easy to remember.  If you want peg words, say “ages run in sequence.”  To learn more about pegs, search for “peg” in my blog.  Because 1900 is 0, 2000 is 6, 2100 will be 4, 2200 will be 2, etc.  1800 is 2.

Keep 2 in your head and move forward.

Now convert the year, and there are two steps.  First, the year mod 7 because each year is one day longer than a multiple of 7, namely 364. 72 mod 7 is 2.  Add 2 to the 2 we’re carrying to get 4 so far.

Now get the number of leap years in the century.  That’s 72 / 4, or 18, which is 4.  Add it to the 4 we’re keeping, which is 8, which is 1.

Now get the month.  Here are peg mnemonics for months:

Mar    Irish          4  St. Patrick's Day
Apr    Easter         0
May    National       2  Memorial Day
Jun    Altar          5  Lots of weddings in June
Jul    Sun or Summer  0  First full sunny month of summer
Aug    Moon           3  Start seeing harvest moons in Aug
Sep    Job            6  Labor Day
Oct    Travel         1  Columbus Day
Nov    Restaurant     4  Eat turkey in a restaurant
Dec    Church         6  Christmas in a church
Jan    New            2  New-Year's Day
Feb    Love           5  St. Valentine's Day

If you forget one, you can recalculate a month number by just adding up the 30 = 2 and 31 = 3 days from the beginning of the year in March (mod 7, of course). The day counts for the months go like this: 32323/32323/30, nice easy pattern, or you can sing the “30 days hath September, April, June, and November” ditty if you prefer. Whatever works.

We’re carrying a 1 in head.  Add a 4 for Nov, giving 5.  Almost done.

29 mod 7 is 1; add our 5, we get 6.  29 Nov 1872 was a Friday.

Do this a few times and check yourself against Google or  You’ll make a few mistakes when getting started, but after a little while you’ll be able to do it quickly and reliably.


~ by rebcabin on July 3, 2015.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: