This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A008685 #37 Jul 08 2025 01:19:55 %S A008685 31,28,31,30,31,30,31,31,30,31,30,31,31,28,31,30,31,30,31,31,30,31,30, %T A008685 31,31,28,31,30,31,30,31,31,30,31,30,31,31,29,31,30,31,30,31,31,30,31, %U A008685 30,31,31,28,31,30,31,30,31,31,30,31,30,31,31,28,31 %N A008685 Lengths of months in the Gregorian calendar. %C A008685 To make the definition unambiguous, consider these as starting from January 2001 (or, equivalently, AD 1 in the proleptic Gregorian calendar). [_Charles R Greathouse IV_, Sep 28 2011] %H A008685 Charles R Greathouse IV, <a href="/A008685/b008685.txt">Table of n, a(n) for n = 1..10000</a> %H A008685 <a href="/index/Ca#calendar">Index entries for sequences related to calendars</a> %H A008685 <a href="/index/Rec#order_4800">Index entries for linear recurrences with constant coefficients</a>, order 4800. %F A008685 a(n) = a(n-4800). [_Charles R Greathouse IV_, Sep 28 2011] %t A008685 year1 = 2001; year2 = 2100; %t A008685 PreviousDate[#, "Day"][[1, 3]]& /@ Flatten[Table[{#, m, 1}, {m, Append[ Range[2, 12], 1]}]& /@ Range[year1, year2], 1] (* _Jean-François Alcover_, Aug 01 2018 *) %o A008685 (PARI) v=[];for(n=1,50,v=concat(v,[31, if(n%4||(n%100==0&&n%400),28,29), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]));v %o A008685 (Haskell) %o A008685 a008685 n = a008685_list !! (n-1) %o A008685 a008685_list = concatMap t [1..] where %o A008685 t y = [31, 28 + leap, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] %o A008685 where leap = if mod y 4 == 0 && %o A008685 (mod y 100 > 0 || mod y 400 == 0) then 1 else 0 %o A008685 -- _Reinhard Zumkeller_, Jun 19 2015 %o A008685 (Python) %o A008685 def a(n): %o A008685 y, m = 1 + (n-1)//12, (n-1)%12 %o A008685 leap = int((y%4 == 0 and y%100 != 0) or y%400 == 0) %o A008685 return [31, 28+leap, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][m] %o A008685 print([a(n) for n in range(1, 64)]) # _Michael S. Branicky_, Feb 04 2024 %Y A008685 Cf. A061251. %K A008685 nonn,easy %O A008685 1,1 %A A008685 _N. J. A. Sloane_