Finding the day of the week ultimately comes down to calculating the number n of days that have elapsed since a fixed, known reference date—for example, January 1st, 1900 (which was a Monday). Once n is known, we calculate the remainder r when n is divided by 7, which automatically gives the day we want: if r = 0, it is the same day as the reference day (Monday, in this case); if r = 1, it is one day later (Tuesday); and so on. This process of replacing a number by its remainder upon division by 7 is known as working modulo 7.
Put like that, it still sounds rather complicated, especially when it comes to finding the value of n. Fortunately, several authors have come to the rescue, notably Lewis Carroll and John Horton Conway.
Lewis Carroll's ideas
------------------------------