It is based on a look up table. Each year starts with a 'day' (Sunday, Monday ..) and the pattern repeats every 7 or 8 years, so if you know the look up table for 7 or 8 years, you can go back forever.
You can also check if your son has "Eidetic memory" . It comes in very handy sometimes ;).