Most years have 52 weeks, some have 53, according to ISO8601.



Task

Write a function which determines if a given year is long (53 weeks) or not, and demonstrate it.




firstyear = 2000;
lastyear = 2099;
years = Range[firstyear, lastyear];
firstday = Table[DayName[{years[[n]], 01, 01}], {n, Length[years]}];
lastday = Table[DayName[{years[[n]], 12, 31}], {n, Length[years]}];
Table[If[years[[n]] >= 1582, 
  If[firstday[[n]] == Thursday || lastday[[n]] == Thursday, 
   Style[years[[n]] " long year \n", Bold, Red] , 
   years[[n]] " short \n"], "error \n"], {n, Length[years]}]