Subject: Day of the week
Date: Wed, 17 Jun 1998 02:20:15 -0400
From: Roger C. Evans

If I later recall in what text I encountered the working out of the day-of-week-from-date problem I'll send the reference on (possibly Oystein Ore's "Number Theory and Its History"?). In any case, the following computation will allow you to reconstruct tables for your memory trick (that'll work for any dates in the Gregorian calendar):

USING THESE CONVENTIONS:
------------------------

-- for a real-date = (month, day, year): IF month is NOT Jan. or Feb., let the "working-date" be the real-date; OTHERWISE, let working-date be (month, day, year-1). Identify the working-date as the number triplet (M, D, Y), where M = 1, ... ,12 for March, ... , December, Jan, and Feb. respectively (note the cyclic shift!) and D = the day number in the month. Represent year Y by Y1 and Y2, given respectively by first and last two digits of Y (thus Y = 1941 --> Y1 = 19, and Y2 = 41).

-- G(x) = "greatest integer in x";
thus G(10.3) = 10 = G(10).

-- Q(m;n) = "quotient m over n" = G(m/n);
thus Q(18;4) = G(4.5) = 4.

-- R(m;n) = "remainder m over n" = m - n*Q(m;n);
thus R(39;7) = 39 - 7*5 = 4.

THE RESULT IS A "MOD 7" CALCULATION:
------------------------------------

Set X = 2*M + D + 5*Y1 + Y2 + Q(3*M-1;5) + Q(Y1;4) + Q(y2:4).

Then ANS = R(X;7),

    where
    0 -->Sunday; 1 -->Monday; ...; and 7 -->Saturday.

-----------------------------------------------------
EXAMPLES:
---------

  1. Real date (Dec. 7, 1941) --> (M, D, Y1, Y2) = (10, 7, 19, 41)
    so
      X = 2*M + D + 5*Y1 + Y2 + Q(3*M-1;5) + Q(Y1;4) + Q(y2:4)
      = 20 + 7 + 95 + 41 + 5 + 4 + 10 = 182.

    ANS = R(182;7) = 0 --> Sunday.

  2. One may of course work mod 7 throughout:
    Real date (Jan. 1, 2000) --> working date (Jan. 1. 2000) -->
    (M, D, Y1, Y2) = (11, 1, 19, 99)
    so
      X = 2*M + D + 5*Y1 + Y2 + Q(3*M-1;5) + Q(Y1;4) + Q(y2:4)
      = 1 + 1 + 4 + 1 + 6 + 4 + 3
      = 6 --> Saturday.
--------------------------------------------------------------------

|Reply| |Up| |Exchange index| |Contents| |Store|

Copyright © 1996-2012 Alexander Bogomolny

 40615804

A math books store at a unique math study site. Shopping at the store helps maintain the site. Thank you.
Sites for teachers
Sites for parents
Terms of use
Awards
Interactive Activities

CTK Exchange
CTK Wiki Math
CTK Insights - a blog
Math Help
Games & Puzzles
What Is What
Arithmetic
Algebra
Geometry
Probability
Outline Mathematics
Make an Identity
Book Reviews
Stories for Young
Eye Opener
Analog Gadgets
Inventor's Paradox
Did you know?...
Proofs
Math as Language
Things Impossible
Visual Illusions
My Logo
Math Poll
Cut The Knot!
MSET99 Talk
Old and nice bookstore
Other Math sites
Front Page
Movie shortcuts
Personal info
Privacy Policy

Guest book
News sites

Recommend this site

Sites for parents

Education & Parenting

Search:
Keywords:

Google
Web CTK
Supported by
3wVentures