OFFSET
1,1
COMMENTS
In the Julian calendar, a year is a leap year if and only if it is a multiple of 4 and all century years are leap years.
Assuming this fact, this sequence is periodic with a period of 28.
The statement about the period is misleading: this is the sequence of (positive) numbers congruent to 5 or -5 (mod 28). It is strictly increasing, not periodic; the sequence a(n) - 28*floor(n/2) is 2-periodic. - M. F. Hasler, Apr 14 2015
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
Time And Date, Repeating Calendar
Time And Date, Julian Calendar
Index entries for linear recurrences with constant coefficients, signature (1,1,-1).
FORMULA
a(n+1) = a(n-1)+28, for all n > 1. - M. F. Hasler, Apr 14 2015
a(2n) = 28n-5 (n>0), a(2n+1) = 28n+5 (n>=0), a(n) = 28*floor(n/2)-5*(-1)^n. - M. F. Hasler, Apr 14 2015
From Colin Barker, Oct 15 2019: (Start)
G.f.: x*(5 + 18*x + 5*x^2) / ((1 - x)^2*(1 + x)).
a(n) = a(n-1) + a(n-2) - a(n-3) for n>3.
a(n) = -7 + 2*(-1)^n + 14*n.
(End)
MATHEMATICA
LinearRecurrence[{1, 1, -1}, {5, 23, 33}, 70] (* Harvey P. Dale, May 21 2021 *)
PROG
(PARI) for(i=0, 420, j=0; for(y=0, 420, if(((5*(y\4)+(y%4))%7)==((5*((y+i)\4)+((y+i)%4))%7), j=1; break)); for(y=0, 420, if(((5*(y\4)+(y%4))%7)==((5*((y+i)\4)+((y+i)%4))%7)&&((5*(y\4)+(y%4)-!(y%4))%7)==((5*((y+i)\4)+((y+i)%4)-!((y+i)%4))%7), j=2; break)); if(j==1, print1(i", ")))
(PARI) A231002(n) = n\2*28-5*(-1)^n \\ M. F. Hasler, Apr 14 2015
(PARI) Vec(x*(5 + 18*x + 5*x^2) / ((1 - x)^2*(1 + x)) + O(x^50)) \\ Colin Barker, Oct 15 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Aswini Vaidyanathan, Nov 02 2013
STATUS
approved