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+(1+i)*(-i)^n+(1-i)*i^n+6*n)/4 where i=sqrt(-1).
G.f.: x^2*(1+x+3*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 15 2012
Sum_{n>=2} (-1)^n/a(n) = log(3)/4 + 2*log(2)/3 - sqrt(3)*Pi/36. - Amiram Eldar, Dec 16 2021
MAPLE
A047269:=n->(-7+(-1)^n+(1+I)*(-I)^n+(1-I)*I^n+6*n)/4: seq(A047269(n), n=1..100); # Wesley Ivan Hurt, May 22 2016
MATHEMATICA
Select[Range[0, 4000], MemberQ[{0, 1, 2, 5}, Mod[#, 6]]&] (* Vincenzo Librandi, May 15 2012 *)
LinearRecurrence[{1, 0, 0, 1, -1}, {0, 1, 2, 5, 6}, 80] (* Harvey P. Dale, Jun 21 2022 *)
PROG
(Magma) I:=[0, 1, 2, 5, 6]; [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+x^3)/((1-x)^2*(1+x)*(1+x^2)))) \\ Altug Alkan, Dec 24 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved