OFFSET
0,2
COMMENTS
See example and the link for more explanation and limits of validity.
The offset is motivated by the special status of the initial term a(0)=0.
REFERENCES
Alexandre Moatti, Récréations mathéphysiques, Editions le Pommier. ISBN: 9782746504875.
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Charles R Greathouse IV, Re: Super-birthdays, seqfan list, Jan 2011.
Index entries for linear recurrences with constant coefficients, signature (1, 0, 0, 1, -1).
FORMULA
From Alexander R. Povolotsky, Jan 18 2011: (Start)
G.f.: (5 + 6*x + 11*x^2 + 6*x^3)/((-1 + x)^2*(1 + x + x^2 + x^3)).
a(n) = +1*a(n-1) + 1*a(n-4) - 1*a(n-5). (End)
EXAMPLE
A standard year has 365 = 350+14+1 = 1 (mod 7) days,
and a leap year has 366 = 2 (mod 7) days.
A super-birthday occurs when this sums up to a multiple of 7. For a birth in the year preceding a Feb 29:
2+1+1+1+2 = 7, after 5 years,
1+1+1 +2+1+1 = 7, 6 years later, i.e. age of 11,
1+2+1+1+1+2+1+1 +1+2+1 = 14, 11 years later: age of 22,
1+1+2+1+1+1 = 7, 6 years later, age of 28,
and then the same cycles repeat.
MATHEMATICA
LinearRecurrence[{1, 0, 0, 1, -1}, {0, 5, 11, 22, 28}, 50] (* G. C. Greubel, Feb 19 2017 *)
PROG
(PARI) a(n)=[0, 5, 11, 22][n%4+1]+n\4*28
CROSSREFS
KEYWORD
nonn
AUTHOR
Eric Angelini and M. F. Hasler, Jan 16 2011
STATUS
approved