## optimal leap year

**A** riddle about leap years: a solar year consists of approximately 365.24217 mean solar days, which is why there is a leap year approximately every four years. Approximately because the Gregorian calendar plans 97 and not 100 leap years over 400 years. Is this the optimal solution? No, since the Gregorian difference is 3.3 10⁻⁴ day per year, or 0.132 day per 400 years, while using 85 leap years over every 351 years leads to a difference of 4.76 10⁻⁶ day per year, or 0.002 day per 400 years… (With a further gain by a factor 4 with 116 leap years every 479 years.) This can be found by a basic R code

for(N in 10:1000) for(L in 1:N){ p=abs(L/N-.24217) if(p<T){T=p;lo=L;no=N}}

November 19, 2022 at 8:21 am

[…] article was first published on R – Xi’an’s Og, and kindly contributed to R-bloggers]. (You can report issue about the content on this page […]