login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A008685 Lengths of months in the Gregorian calendar. 9

%I

%S 31,28,31,30,31,30,31,31,30,31,30,31,31,28,31,30,31,30,31,31,30,31,30,

%T 31,31,28,31,30,31,30,31,31,30,31,30,31,31,29,31,30,31,30,31,31,30,31,

%U 30,31,31,28,31,30,31,30,31,31,30,31,30,31,31,28,31

%N Lengths of months in the Gregorian calendar.

%C 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 Charles R Greathouse IV, <a href="/A008685/b008685.txt">Table of n, a(n) for n = 1..10000</a>

%H <a href="/index/Ca#calendar">Index entries for sequences related to calendars</a>

%H <a href="/index/Rec#order_4800">Index entries for linear recurrences with constant coefficients</a>, order 4800.

%F a(n) = a(n-4800). [_Charles R Greathouse IV_, Sep 28 2011]

%t year1 = 2001; year2 = 2100;

%t 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 (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 (Haskell)

%o a008685 n = a008685_list !! (n-1)

%o a008685_list = concatMap t [1..] where

%o t y = [31, 28 + leap, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]

%o where leap = if mod y 4 == 0 &&

%o (mod y 100 > 0 || mod y 400 == 0) then 1 else 0

%o -- _Reinhard Zumkeller_, Jun 19 2015

%Y Cf. A061251.

%K nonn,easy

%O 1,1

%A _N. J. A. Sloane_.

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 26 16:03 EDT 2019. Contains 323597 sequences. (Running on oeis4.)