OFFSET
1,3
LINKS
Bruno Berselli, 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+2*x^2+4*x^3) / ( (1+x)*(1+x^2)*(1-x)^2 ). - R. J. Mathar, Oct 08 2011
a(n) = 2*n-4+(3-(-1)^n)*(1-i^(n*(n+1)))/4, where i=sqrt(-1). - Bruno Berselli, Jul 18 2012
From Wesley Ivan Hurt, Jun 01 2016: (Start)
a(n) = a(n-1) + a(n-4) - a(n-5) for n>5.
Sum_{n>=2} (-1)^n/a(n) = (1+2*sqrt(2))*Pi/32 + (3+sqrt(2))*log(2)/16 - sqrt(2)*log(2-sqrt(2))/8. - Amiram Eldar, Dec 20 2021
MAPLE
A047466:=n->2*n-4+(3-I^(2*n))*(1-I^(n*(n+1)))/4: seq(A047466(n), n=1..100); # Wesley Ivan Hurt, Jun 01 2016
MATHEMATICA
Select[Range[0, 120], MemberQ[{0, 1, 2, 4}, Mod[#, 8]] &] (* or *) LinearRecurrence[{1, 0, 0, 1, -1}, {0, 1, 2, 4, 8}, 60] (* Bruno Berselli, Jul 18 2012 *)
PROG
Contribution from Bruno Berselli, Jul 18 2012: (Start)
(Magma) [n: n in [0..120] | n mod 8 in [0, 1, 2, 4]];
(Maxima) makelist(2*n-4+(3-(-1)^n)*(1-%i^(n*(n+1)))/4, n, 1, 60);
(PARI) concat(0, Vec((1+x+2*x^2+4*x^3)/((1+x)*(1+x^2)*(1-x)^2)+O(x^60))) (End)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved