OFFSET
1,3
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,0,0,0,1,-1).
FORMULA
G.f.: x^2*(1 + x + 3*x^2 + 2*x^3 + x^4)/((1-x)^2*(1 + x + x^2 + x^3 + x^4)). - Colin Barker, May 14 2012
a(n) = a(n-1) + a(n-5) - a(n-6). - Vincenzo Librandi, May 17 2012
MATHEMATICA
Select[Range[0, 300], MemberQ[{0, 1, 2, 5, 7}, Mod[#, 8]]&] (* Vincenzo Librandi, May 17 2012 *)
LinearRecurrence[{1, 0, 0, 0, 1, -1}, {0, 1, 2, 5, 7, 8}, 80] (* Harvey P. Dale, Jul 04 2021 *)
PROG
(Magma) I:=[0, 1, 2, 5, 7, 8]; [n le 6 select I[n] else Self(n-1)+Self(n-5)-Self(n-6): n in [1..70]]; // Vincenzo Librandi, May 17 2012
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved