I know many people, when doing calendar calculating, use either the classic formula for the last two digits of the year ((y + floor(y/4)) mod 7) or the odd + 11 approach, but I’ve found a way that is faster for me, partially because it involves fewer steps.
To be clear, I worked this method out for myself and haven’t found any other references to it, but I have to believe that someone else out there had to develop this before I did. (Heh - probably the quickest way to find the actual originator of it would be to publish it and claim that no one has ever done it before.)
Here’s how it goes:
- Let Y=the last 2 digits of the year.
- Break Y up into an addition problem consisting of two addends, with one being the largest multiple of 4 equal to or lower than Y, and the other being a remainder of 1, 2, or 3 (if needed).
- In this newly-formed addition problem, divide ONLY the multiple of 4 by 2, and change the plus sign to a minus sign.
- Solve the subtraction problem you created in step 3.
- Find the smallest multiple of 7 which is equal to or greater than the answer from step 4, and subtract step 4’s answer from that number. This is the year key.
Example:
- Y=47
- 47 becomes 44 + 3
- 44 + 3 is transformed into 22 - 3.
- 22 - 3 = 19.
- 21 is the smallest multiple of 7 which is equal to or greater than 19, so we work out 21 - 19 = 2, so 2 is the year key for years ending in 47.
Just so you can see that they all deliver the same results, I’ve run each of these approaches on Wolfram Alpha for all the years from 0 to 99 below.
Here’s the classic ((x+(floor(x/4))) mod 7) approach:
Here’s the popular “Odd + 11” approach:
Here’s my approach:
Any thoughts or questions on this approach?