The idea came from watching The Mentalist. I saw Patrick Jane calculate the day of the week mentally, which made me curious about how that was possible. So I searched for the mathematical formula ...