View Single Post
Old 01-03-2008, 12:12 PM   #1 (permalink)
telekinetic
zomgomgomgomgomgomg
 
telekinetic's Avatar
 
Location: Fauxenix, Azerona
How to figure out the day of the week by the date

Ignore the goofy url, this is a really fascinating mental exercise. I just started reading it, but i'm definitely going to try to commit it to memory:

http://www.h2limousine.com/calendar2.php

Basically, the day of the week (1=sunday, 2= Monday...0=saturday) is:

(Month code + year code + day of the month) mod 7.

Month codes:
January: 1
February: 4
March: 4
April: 0
May: 2
June: 5
July: 0
August: 3
September: 6
October: 1
November: 4
December: 6

Year codes:
2005: 5
2006: 6
2007: 0
2008: 2
2009: 3
2010: 4

The 'mod' operation means 'subtract seven until you can't subtract seven any more without getting a negative number. Thus, Mod 25 would be [ 25-7 (18) - 7 (11) - 7 ] =4

A practical example. My sister's birthday is April 15th. Her 21st is this year, and I'm curious whether it's on a weekend, as she wants me to come out.
Month: 0
Year: 2
Day: 15

17 mod 7 = 3. d'oh, it's a Tuesday.

That's the cliff notes version, but check out the site if it at all interests you

Anyone else have any cool math tricks? I class this about three times as easy as memorizing a substancial number of digits of pi (which I still have out to 3.141592653589793238...used to have more), and thirty times as useful
__________________
twisted no more

Last edited by telekinetic; 01-03-2008 at 12:16 PM..
telekinetic is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73