week = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'] # Determine the anchor day for the century year = 2006 century = year/100 + 1 a = century * 5 b = (century - 1) / 4 c = a + b anchor = (c + 4) % 7 # Determine the Doomsday for the year in question e = (year % 100)/12 f = (year % 100)%12 g = f/4 h = e + f + g dday = (h + anchor) % 7 """In code The following is the algorithm in C. Note that division in C (using the / operator) is integer division and that the % operator is the modulo operator. Set "year" to whatever year (this case is 2005) computation is desired and the numeric values of the days of the week are: 0 – Sunday 1 – Monday 2 – Tuesday 3 – Wednesday 4 – Thursday 5 – Friday 6 – Saturday // Determine the anchor day for the century year = 2005; century = year/100 + 1; a = century * 5; b = (century - 1) / 4; c = a + b; anchor = (c + 4) % 7; // Determine the Doomsday for the year in question e = (year % 100)/12; f = (year % 100)%12; g = f/4; h = e + f + g; dday = (h + anchor) % 7; "anchor" is the anchor day for the century and "dday" is the doomsday for the year. If "dday" is found to be Monday, then January 3 (or 4th), February 28 (or 29th), March 0, April 4, May 9, etc. (see above). To find the day of the date in question, determine the number of days away from the doomsday (as a positive value after and a negative before) for that month and add it to "dday" modulo 7. """