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.




get "libhdr"
 
let p(y) = (y + y/4 - y/100 + y/400) rem 7
let longyear(y) = p(y)=4 | p(y-1)=3
 
let start() be 
    for y = 2000 to 2100
        if longyear(y) do writef("%N*N", y)