There is a formula or a method given by Sir John Conway to find any given year anchor day after year 1800 assuming that we are using Gregorian calendar .For example for finding anchor day (also known as the day of first date which is January 1) in year 2005 ,Sir John Conway used this method in his doomsday algorithm to find anchor day of year 2005 :
y=last two digits of the year ,here it is 05.
so to find anchor day we compute (floor(y/12)+(y mod 12)+ (floor(ymod12/4))mod 7) +2 which turns out to be 1 or Monday ,which is anchors day of year 2005.
So, could anyone explain me the working of this formula and how this work exactly after year 1800 even if it is a leap year