login
A377293
Number of days where month plus day equals n, in a non-leap year in the Gregorian calendar.
0
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,2
COMMENTS
Sum of all terms gives 365.
EXAMPLE
For n=4 three dates (1st of March, 2nd of February, 3rd of January) sum to n, so a(4) = 3.
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 *)
PROG
(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]
CROSSREFS
Cf. A008685.
Sequence in context: A327886 A331166 A304232 * A357030 A303219 A071523
KEYWORD
nonn,dumb,easy,fini,full
AUTHOR
Manuel Biwer, Dec 27 2024
STATUS
approved