OFFSET

1,1

LINKS

Jinyuan Wang, Table of n, a(n) for n = 1..365

EXAMPLE

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.

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 *)

PROG

(C++)

#include <iostream>

using namespace std;

int main(){

int m=1;

for(int d=30; m<=12; d--){

cout<<d<<", ";

if(d==0){

m++;

if(m==4||m==6||m==9||m==11)

d=30;

else if(m==2)

d=28;

else

d=31;

}

}

}

CROSSREFS

KEYWORD

nonn,fini,full

AUTHOR

Andrew Pham, Sep 27 2019

STATUS

approved