The Handy Calendar

What day of the week is it? For calendar calculating like savant syndrome.

HOME > English > Tutorial > The process

The process

Now, consider the integers M, D and Y as 1 ≤ M ≤ 12, 1 ≤ D ≤ 31, and 1 ≤ Y ≤ 9999, and try conducting the following process. What was the last position you counted? When M, D and Y represents the month, day and year in the Gregorian calendar, the day of the week on that date is revealed by the last position you counted. In other words, the numbers from 0, 1, … to 6 correspond to Sunday, Monday… up to Saturday.

Step 1
Arriving to the position of M, the month.
Step 2
If M < 3, we count it as 1.
If M ≥ 3, we count it as 0.
Step 3
We count numbers, each of which is larger by 2000 from the previous one, as long as it isn’t larger than Y.
Step 4
We count numbers, each of which is larger by 400 from the previous one, as long as it isn’t larger than Y.
Step 5
We count numbers, each of which is larger by 100 from the previous one, as long as it isn’t larger than Y. However, for each number we count, we move the position for 5 places.
Step 6
We count numbers, each of which is larger by 20 from the previous one, as long as it isn’t larger than Y. However, for each number we count, we move the position for 4 places.
Step 7
We count numbers, each of which is larger by 4 from the previous one, as long as it isn’t larger than Y. However, for each number we count, we move the position for 5 places.
Step 8
We count numbers, each of which is larger by 1 from the previous one, as long as it isn’t larger than Y. However, for each number we count, we move the position for 1 place.
Step 9
We count it as 0.
Step 10
We count numbers, each of which is larger by 7 from the previous one, as long as it isn’t larger than D.
Step 11
We count numbers, each of which is larger by 1 from the previous one, as long as it isn’t larger than D. However, for each number we count, we move the position for 1 place.

(Procedures completed)

123