December 9th, 2008, 10:22 pm
The maximum number of Fridays 13th in a year is 3.Define:Months = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};MonthsL = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};AccMonths = Prepend[Most[Accumulate[Months]], 0];AccMonthsL = Prepend[Most[Accumulate[MonthsL]], 0];f[x_] := Mod[x, 7];Map[f, Prepend[Most[Accumulate[Months]], 0]]{0, 3, 3, 6, 1, 4, 6, 2, 5, 0, 3, 5}Map[f, Prepend[Most[Accumulate[MonthsL]], 0]]{0, 3, 4, 0, 2, 5, 0, 3, 6, 1, 4, 6}No number appears more than 3 times (3 for non-leap years and 0 for leap years), and therefore you can only have 3 matching sets of days/weekdays.