login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

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

%I #23 Dec 30 2024 02:19:42

%S 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,

%T 12,12,12,11,11,10,10,8,8,6,6,5,3,3,1,1

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

%C Sum of all terms gives 365.

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

%p (p-> add(coeff(p, x, i), i=2..degree(p)))(add(add(x^(i+j), j=1..

%p [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][i]), i=1..12)); # _Alois P. Heinz_, Dec 27 2024

%o (Python)

%o sequence = []

%o for year in range(2, 43):

%o current_count = 0

%o for month, days_in_month in zip(range(1, 13), (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)):

%o for day in range(1, days_in_month + 1):

%o if month + day == year:

%o current_count += 1

%o sequence += [current_count]

%Y Cf. A008685.

%K nonn,dumb,easy,fini,full,new

%O 2,2

%A _Manuel Biwer_, Dec 27 2024