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.

A377293 Number of days where month plus day equals n, in a non-leap year in the Gregorian calendar.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, 11, 10, 10, 8, 8, 6, 6, 5, 3, 3, 1, 1
Offset: 2

Views

Author

Manuel Biwer, Dec 27 2024

Keywords

Comments

Sum of all terms gives 365.

Examples

			For n=4 three dates (1st of March, 2nd of February, 3rd of January) sum to n, so a(4) = 3.
		

Crossrefs

Cf. A008685.

Programs

  • Maple
    (p-> add(coeff(p, x, i), i=2..degree(p)))(add(add(x^(i+j), j=1..
    [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][i]), i=1..12));  # Alois P. Heinz, Dec 27 2024
  • Mathematica
    dON[d_]:=With[{d1=Take[DateList[d],3]},d1[[2]]+d1[[3]]]; Tally[dON/@DateRange[{2025,1,1},{2025,12,31}]][[;;,2]] (* Harvey P. Dale, Feb 16 2025 *)
  • Python
    sequence = []
    for year in range(2, 43):
        current_count = 0
        for month, days_in_month in zip(range(1, 13), (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)):
            for day in range(1, days_in_month + 1):
                if month + day == year:
                    current_count += 1
        sequence += [current_count]