OFFSET
1,2
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) = (-5-(-1)^n-(1-i)*(-i)^n-(1+i)*i^n+4*n)/2 where i=sqrt(-1).
G.f.: x*(1+x+x^2+x^3+4*x^4)/((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 15 2012
Sum_{n>=1} (-1)^(n+1)/a(n) = (2*sqrt(2)-1)*Pi/16 + 3*log(2)/8. - Amiram Eldar, Dec 23 2021
MAPLE
A047454:=n->(-5-I^(2*n)-(1-I)*(-I)^n-(1+I)*I^n+4*n)/2: seq(A047454(n), n=1..100); # Wesley Ivan Hurt, Jun 01 2016
MATHEMATICA
Select[Range[0, 300], MemberQ[{1, 2, 3, 4}, Mod[#, 8]]&] (* Vincenzo Librandi, May 15 2012 *)
PROG
(Magma) I:=[1, 2, 3, 4, 9]; [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) my(x='x+O('x^100)); Vec(x*(1+x+x^2+x^3+4*x^4)/((1-x)^2*(1+x)*(1+x^2))) \\ Altug Alkan, Dec 24 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved