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,1,-1).
FORMULA
G.f.: x^2*(1+x+3*x^2+2*x^3)/((1-x)^2*(1+x)*(1+x^2)). - Colin Barker, May 13 2012
a(n) = (-19+(-1)^n+(1+3*i)*(-i)^n+(1-3*i)*i^n+14*n)/8 where i=sqrt(-1). - Colin Barker, May 14 2012
a(n) = a(n-1) + a(n-4) - a(n-5) for n>5. - Vincenzo Librandi, May 16 2012
MAPLE
A047388:=n->(-19+I^(2*n)+(1+3*I)*(-I)^n+(1-3*I)*I^n+14*n)/8: seq(A047388(n), n=1..100); # Wesley Ivan Hurt, Jun 01 2016
MATHEMATICA
Select[Range[0, 300], MemberQ[{0, 1, 2, 5}, Mod[#, 7]]&] (* Vincenzo Librandi, May 15 2012 *)
LinearRecurrence[{1, 0, 0, 1, -1}, {0, 1, 2, 5, 7}, 80] (* Harvey P. Dale, Jan 10 2023 *)
PROG
(Magma) I:=[0, 1, 2, 5, 7]; [n le 5 select I[n] else Self(n-1)+Self(n-4)-Self(n-5): n in [1..70]]; // Vincenzo Librandi, May 15 2012
(PARI) x='x+O('x^100); concat(0, Vec(x^2*(1+x+3*x^2+2*x^3)/((1-x)^2*(1+x)*(1+x^2)))) \\ Altug Alkan, Jun 02 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved