N = d + 2m + [3(m+1)/5] + y + [y/4] - [y/100] + [y/400] + 2
where d is the number or the day of the month, m is the number of the
month, and y is the year. The brackets around the divisions mean to
drop the remainder and just use the integer part that you get.
Also, a VERY IMPORTANT RULE is the number to use for the months for
January and February. The numbers of these months are 13 and 14 of the
PREVIOUS YEAR. This means that to find the day of the week of New
Year's Day this year, 1/1/98, you must use the date 13/1/97. (It
sounds complicated, but I will
do a couple of examples for you.)
After you find the number N, divide it by 7, and the REMAINDER of that
division tells you the day of the week; 1 = Sunday, 2 = Monday, 3 =
Tuesday, etc; BUT, if the remainder is 0, then the day is Saturday,
that is: 0 = Saturday.
As an example, let's check it out on today's date, 3/18/98. Plugging
the numbers into the formula, we get;
N = 18 + 2(3) + [3(3+1)/5] + 1998 + [1998/4] - [1998/100]
+ [1998/400] + 2
So doing the calculations, (remember to drop the remainder for the
divisions that are in the brackets) we get;
N = 18 + 6 + 2 + 1998 + 499 - 19 + 4 + 2 = 2510
Now divide 1510 by 7 and you will get 358 with a remainder of 4. Since
4 corresponds to Wednesday, then today must be Wednesday.
You asked about New Year's Day, so let's look at this year, 1/1/98.
Because of the "Very Important Rule," we must use the "date" 13/1/97
to find New Year's Day this year. Plugging into the formula, we get;
N = 1 + 2(13) + [3(13+1)/5] + 1997 + [1997/4] - [1997/100]
+ [1997/400] + 2
N = 1+ 26 + 8 + 1997 + 499 - 19 + 4 + 2 = 2518
Now divide 2518 by 7 and look at the remainder: 2518/7 = 359 with a
remainder of 5. Since 5 corresponds to Thursday, New Year's Day this
year was on a Thursday.
Tuesday, January 18, 2011
Here is a formula for finding the day of the week for ANY date
Here is a formula for finding the day of the week for ANY date.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment