cp's OEIS Frontend

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.

Showing 1-7 of 7 results.

A008685 Lengths of months in the Gregorian calendar.

Original entry on oeis.org

31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31
Offset: 1

Views

Author

Keywords

Comments

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]

Crossrefs

Cf. A061251.

Programs

  • Haskell
    a008685 n = a008685_list !! (n-1)
    a008685_list = concatMap t [1..] where
       t y = [31, 28 + leap, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
             where leap = if mod y 4 == 0 &&
                             (mod y 100 > 0 || mod y 400 == 0) then 1 else 0
    -- Reinhard Zumkeller, Jun 19 2015
    
  • Mathematica
    year1 = 2001; year2 = 2100;
    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 *)
  • 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
    
  • Python
    def a(n):
        y, m = 1 + (n-1)//12, (n-1)%12
        leap = int((y%4 == 0 and y%100 != 0) or y%400 == 0)
        return [31, 28+leap, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][m]
    print([a(n) for n in range(1, 64)]) # Michael S. Branicky, Feb 04 2024

Formula

a(n) = a(n-4800). [Charles R Greathouse IV, Sep 28 2011]

A073304 Remaining days in non-leap year at end of n-th month.

Original entry on oeis.org

365, 334, 306, 275, 245, 214, 184, 153, 122, 92, 61, 31, 0
Offset: 0

Views

Author

Rick L. Shepherd, Jul 23 2002

Keywords

Examples

			a(6)=184 because there are 184 days left in a (non-leap) year on Jun 30, the sixth month.
		

Crossrefs

Cf. A073305 (remaining days in leap year), A061251 (elapsed days at end of n-th month beginning with non-leap year).

A073305 Remaining days in leap year at end of n-th month.

Original entry on oeis.org

366, 335, 306, 275, 245, 214, 184, 153, 122, 92, 61, 31, 0
Offset: 0

Views

Author

Rick L. Shepherd, Jul 23 2002

Keywords

Comments

a(0)=A073304(0)+1 and a(1)=A073304(1)+1; these sequences otherwise are identical since there is only one leap day and it is in the second month.

Examples

			a(1)=335 because there are 335 days left in a leap year at the end of January, the first month.
		

Crossrefs

Cf. A073304 (remaining days in non-leap year), A061251 (elapsed days at end of n-th month beginning with non-leap year).

Programs

  • Mathematica
    Join[{366},(DateDifference[#,{2016,12,31}]&/@Table[Select[Table[ DatePlus[ {2016,m,1},{d,"Day"}],{d,30}],#[[2]]==m&][[-1]],{m,12}])[[All,1]]] (* Harvey P. Dale, Nov 29 2020 *)

A116386 Number of calendar weeks in the year n (starting at n=0 for the year 2000).

Original entry on oeis.org

54, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 54, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 54, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53
Offset: 0

Views

Author

Sergio Pimentel, Mar 15 2006

Keywords

Comments

Since 365/7 = 52.14 > 52, every year has at least 53 weeks (although the first and / or the last calendar weeks might not be complete and belong to two different years). Only if a leap year begins in a Saturday (the last day of the calendar week), a year can have 54 different calendar weeks (being the first and last of only one day). Years with 54 calendar weeks are: 2000, 2028, 2056, 2084, 2124, 2152, etc. It happens 13 times in a 400 year cycle.

Examples

			E.g. a(0)=54 because the year 2000 had 54 calendar weeks (since Jan 01 2000 was a Saturday and Dec 31 2000 was a Sunday)
		

Crossrefs

A189915 Sequence for finding the day of the week for the first day of the month in a common (non-leap) year.

Original entry on oeis.org

0, 3, 3, 6, 1, 4, 6, 2, 5, 0, 3, 5
Offset: 1

Views

Author

Wolfdieter Lang, May 02 2011

Keywords

Comments

The days of the week, starting with Sunday, have indices 0,1,...,6. The months of the year, starting with January, are numbered 1,2,...,12. The following pattern holds for common (non-leap) years.
See A189916 for leap years.
If Jan 01 falls on a day of the week with index I, then Feb 01 is on the day with index I+3 (mod 7), Mar 01 is also on the day with index I+3 (mod 7), Apr 01 is on the day with index I+6 (mod 7), etc.
If one uses 0->A, 1->B, 2->C, 3->D, 4->E, 5->F and 6->G the sequence becomes
A, D, D, G, B, E, G, C, F, A, D, F.
A mnemonic rhyme for this sequence is in English:
At Dover dwells George Brown, Esquire,
Good Christopher Fitch and David Frier.
In German (attributed to Thomas Brown, Oxford):
Allvater, der du gnaedig bist,
Ein gesetzestreuer Christ
Fordert Ablauf dieser Frist.
See the L. Holford-Strevens reference pp. 106-7 (German translation).

Examples

			In the year 2011 Jan 01 has index 6 (Saturday). Therefore, Feb 01 has index 6+3 = 2 (mod 7) (Tuesday), Mar 01 also has index 2, Apr 01 has index 6+6 = 5 (mod 7) (Friday), etc.
In common years with Jan 01 on a Sunday (index 0) the sequence gives the index of the first day of the n-th month of this year. E.g., in the year 2006 (but not in the leap year 2012).
		

References

  • L. Holford-Strevens, The History of Time. A Very Short Introduction, Oxford University Press, 2005.
  • L. Holford-Strevens, Kleine Geschichte der Zeitrechnung und des Kalenders, Reclams Universalbibliothek Nr.18483, Stuttgart, 2008 (German translation).

Crossrefs

Cf. A178054 (indices starting with Jan 01 2000), A061251.

Formula

I(n) = I + a(n) (mod 7), n=1,...,12, with I the index of January 01 in a common (non-leap) year, and I(n) the index of the day of the week of the first day of the n-th month in this year.
a(n) = A061251(n) (mod 7), n=0,..,11.
a(n) = A178054(72+n), n=1..12.

A189916 Sequence for finding the day of the week for the first day of the month in leap years.

Original entry on oeis.org

0, 3, 4, 0, 2, 5, 0, 3, 6, 1, 4, 6
Offset: 1

Views

Author

Wolfdieter Lang, May 02 2011

Keywords

Comments

The days of the week, starting with Sunday, have indices 0,1,..,6. The months of the year, starting with January, are numbered 1,2,...,12. The following pattern holds for leap years. Remember that the year 2000 was a leap year. See A189915 for non-leap years.
If Jan 01 falls on a day of the week with index I, then Feb 01 falls on the day with index I+3 (mod 7), Mar 01 falls on the day with index I+4 (mod 7), Apr 01 is again on the day with index I, etc.
If one uses 0->A, 1->B, 2->C, 3->D, 4->E, 5->F and 6->G then the sequence becomes A, D, E, A, C, F, A, D, G, B, E, G.

Examples

			In the year 2008 Jan 01 has index 2 (Tuesday). Therefore, Feb 01 has index 2+3 = 5 (mod 7) (Friday), Mar 01 has index 2+4 = 6 (mod 7) (Saturday), Apr 01 falls again on a Tuesday, May 01 has index 2+2 = 4 (Thursday), Jun 01 has index 2+5= 0 (mod 7) (Sunday). Jul 01 falls again on Tuesday, etc.
For leap years in which Jan 01 has index 0 (Sunday) the pattern for the first days of the months is Sun, Wed, Thu, Sun, Tue, Fri, Sun, Wed, Sat, Mon, Thu, Sat.
		

References

Crossrefs

Cf. A061251, A178054 (index pattern starting with the year 2000), A189915.

Formula

I(n) = I + a(n) (mod 7), n=1,2,..,12, with I the index of the day of Jan 01 in a leap year, and I(n) the index of the first day the n-th month in this year.
a(n) = A061251(35+n) - 1095 mod(7), n=1..12.
a(n) = A178054(144+n), n=1,...,12 (indices for the year 2012).

A327846 Full days remaining in the month on the Gregorian calendar starting at n-th day of a non-leap year.

Original entry on oeis.org

30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6
Offset: 1

Views

Author

Andrew Pham, Sep 27 2019

Keywords

Examples

			On March 27th, the 86th day of the year where n=86, there are 4 full days left in the month of March, a(86)=4.
		

Crossrefs

Programs

  • Mathematica
    Array[Range[# - 1, 0, -1] &@ Which[MemberQ[{4, 6, 9, 11}, #], 30, # == 2, 28, True, 31] &, 12] // Flatten (* Michael De Vlieger, Sep 30 2019 *)
Showing 1-7 of 7 results.