OFFSET
0,8
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (1,1,1,1,1).
FORMULA
a(n) = a(n-1) + a(n-2) + a(n-3) + a(n-4) + a(n-5).
G.f.: (1 -2*x +x^2 -2*x^3 +x^4)/(1 -x -x^2 -x^3 -x^4 -x^5). - Maksym Voznyy (voznyy(AT)mail.ru), Aug 12 2009
MATHEMATICA
a[n_]:= a[n]= If[n<5, (-1)^n, Sum[a[n-j], {j, 5}]];
Table[a[n], {n, 0, 50}]
PROG
(Magma) [n le 5 select (-1)^(n-1) else Self(n-1) +Self(n-2) +Self(n-3) +Self(n-4) +Self(n-5): n in [1..51]]; // G. C. Greubel, Dec 23 2021
(Sage)
@CachedFunction
[A122997(n) for n in (0..50)] # G. C. Greubel, Dec 23 2021
CROSSREFS
KEYWORD
sign
AUTHOR
Artur Jasinski, Oct 28 2006
STATUS
approved