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.




to div :x :y
  output int quotient :x :y
end
 
to dec31_weekday :year
   output remainder (sum :year div :year 4 div :year -100 div :year 400) 7
end
 
to iso_long_year? :year
   output or 4 = dec31_weekday :year 3 = dec31_weekday difference :year 1
end
 
for [y 1995 2045 1] [if iso_long_year? :y [print :y]]