Mathemagics
Doomsday rule
- Determination of the day of the week - Wikipedia
- Doomsday rule - Wikipedia
- The Doomsday Algorithm - Numberphile
The Doomsday rule is an algorithm devised by John Conway to quickly calculate the weekday of any date in history. The algorithm works on the following principle:
There is a set of dates (called doomsdays), that for any year, all fall on the same day (called the anchor day of the year).
Using the anchor, we can find out the weekday for any date using simple arithmetic.
The doomsdays we need to remember in order to use the algorithm are:
MM/DD | Full date | Mnemonic |
---|---|---|
1/3 (1/4 for leap years) | Jan 3 / Jan 4 | - |
2/28 (2/29 for leap years) | Feb 28 / Feb 29 | - |
3/14 | Mar 14 | Pi day |
4/4, 6/6, 8/8, 10/10, 12/12 | April 4, Jun 6, Aug 8, Oct 10, Dec 12 | Even months except Feb |
5/9, 9/5, 7/11, 11/7 | May 9, Sept 5, Jul 11, Nov 7 | 9-to-5 at 7-11 |
Other memorable doomsdays are Jul 4 (Independence day), Oct 31 (Halloween) and Dec 26 (Boxing day).
In total, there are 52 doomsdays in a year. In leap years, the doomsdays in the month of January and February are shifted by one day. However, the total remains the same.
The algorithm involves the following steps.
- Find the anchor day for the century (required for step 2).
- Find the anchor day for the year. All doomsdays fall on this anchor day.
- Count forward/backward from the nearest doomsday to the specified date.
For calculations, we assign an index for each weekday. Starting from Monday () to Sunday (), the index equals .
Day | Index | Mnemonic |
---|---|---|
Monday | 1 | One-day |
Tuesday | 2 | Twos-day |
Wednesday | 3 | Threes-day |
Thursday | 4 | Fours-day |
Friday | 5 | Five-day |
Saturday | 6 | Sixtur-day |
Sunday | 0 | None-day |
Example
Jul 27, 1987
Anchor day for the century (1900s) = 3 (Wednesday)
Anchor day for the year (1987) = 6 (Saturday)
Nearest doomsday to Jul 27 is Jul 11 = Saturday (from step 2).
July 25 = July 11+7+7 = Saturday
July 27 = Monday.
Finding the anchor day for the century
Given a year ,
Let = the first 2 digits of the year (or )
Method 1
Anchor = + Tuesday
Method 2
Value of | Anchor |
---|---|
0 | Tuesday |
1 | Sunday |
2 | Friday |
3 | Wednesday |
Example
1700s
Sunday
Or
+ Tuesday = + Tuesday = Sunday
The following table lists the anchor days for 1500s to 2600s:
Century | Anchor day (Index) |
---|---|
1500s, 1900s, 2300s | Wednesday (3) |
1600s, 2000s, 2400s | Tuesday (2) |
1700s, 2100s, 2500s | Sunday (0) |
1800s, 2200s, 2600s | Friday (5) |
Mnemonics for recent centuries:
- 1900s: We-in-dis-day (most living people were born in that century)
- 2000s: Twos-day or Y-Tue-K
- 2100s: Twenty-one-day is Sunday (2100 is the start of the next century)
Finding the anchor day for the year
Given a year ,
Method 1
Let = Anchor day of the century
Anchor day of the year =
Method 2
Anchor =
Method 3: The "odd+11" method
- Let
- If is odd, add .
- If is odd, add .
- Count forward days from the century's anchor day to get the year's anchor day.
note
Each common year advances the anchor day by one day. Each leap year advances it by two days.
Example
1987
Let
Anchor = = Saturday
It can be useful to use your index, middle, and ring fingers and the pinkie to store the values for , , , and respectively during mental calculations.
Or using "odd+11" method:
-> -> -> -> = = -> Wednesday + 3 = Saturday
Magic squares
To create a 4x4 magic square that adds upto , let and then replace the value of in the following square:
Rapid cube root
This trick relies on the fact that the cubes of single digit whole numbers end in unique digits.
Example: Cube root of ()
Steps:
- Cube just lower than
- Cube ending in
Divisibility rules
Number | Test | Examples |
---|---|---|
The last digit is even | ||
The sum of digits is divisible by 3 | ||
The last 2 digits form number that is divisible by 4 | ||
Ends in 0 or 5 | ||
Is divisible by 2 and 3 | ||
The alternating sum of blocks of three from right to left gives a multiple of 7 | ||
The last three digits form a number that is divisible by 8 | ||
The sum of the digits form a number that is divisible by 9 | ||
The ones digit is 0 | ||
The alternating sum of the digits is divisible by 11 | ||
Is divisible by 3 and 4 | ||
The alternating sum of blocks of three from right to left gives a multiple of 13 | ||
Is divisible by 2 and 7 | ||
Is divisible by 3 and 5 |
Miscellaneous
Sum of 10 consecutive fibonacci numbers is always equal to the 7th term in the series times 11.