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
From Colin Barker, May 14 2012: (Start)
a(n) = (-7-(-1)^n+(2-i)*(-i)^n+(2+i)*i^n+8*n)/4 where i=sqrt(-1).
G.f.: x^2*(1+4*x+2*x^2+x^3)/((1-x)^2*(1+x)*(1+x^2)). (End)
a(n) = a(n-1) + a(n-4) - a(n-5) for n>5. - Vincenzo Librandi, May 16 2012
E.g.f.: (2 - sin(x) + 2*cos(x) + (4*x - 3)*sinh(x) + 4*(x - 1)*cosh(x))/2. - Ilya Gutkovskiy, Jun 02 2016
Sum_{n>=2} (-1)^n/a(n) = (sqrt(2)-1)*Pi/16 + (8-3*sqrt(2))*log(2)/16 + 3*sqrt(2)*log(2+sqrt(2))/8. - Amiram Eldar, Dec 20 2021
MAPLE
A047479:=n->(-7-I^(2*n)+(2-I)*(-I)^n+(2+I)*I^n+8*n)/4: seq(A047479(n), n=1..100); # Wesley Ivan Hurt, Jun 01 2016
MATHEMATICA
Select[Range[0, 300], MemberQ[{0, 1, 5, 7}, Mod[#, 8]]&] (* Vincenzo Librandi, May 16 2012 *)
PROG
(Magma) I:=[0, 1, 5, 7, 8]; [n le 5 select I[n] else Self(n-1)+Self(n-4)-Self(n-5): n in [1..70]]; // Vincenzo Librandi, May 16 2012
(PARI) my(x='x+O('x^100)); concat(0, Vec(x^2*(1+4*x+2*x^2+x^3)/((1-x)^2*(1+x)*(1+x^2)))) \\ Altug Alkan, Dec 24 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved