%I #29 Sep 08 2022 08:45:11
%S 0,1,-1,4,-5,15,-22,57,-93,220,-385,859,-1574,3381,-6385,13380,-25773,
%T 53143,-103702,211585,-416405,843756,-1669801,3368259,-6690150,
%U 13455325,-26789257,53774932,-107232053,214978335,-429124630,859595529,-1717012749,3437550076
%N Expansion of the g.f. x/((1+2x)(1-x-x^2)).
%C Sums of consecutive pairs yield A084178.
%C Number of walks of length n+1 between two vertices at distance 2 in the cycle graph C_5. In general a(n,m) = 2^n/m*Sum_{k=0..m-1} cos(4*Pi*k/m)*cos(2*Pi*k/m)^n is the number of walks of length n between two vertices at distance 2 in the cycle graph C_m. - _Herbert Kociemba_, May 31 2004
%H Robert Israel, <a href="/A084179/b084179.txt">Table of n, a(n) for n = 0..3260</a>
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (-1,3,2).
%F Binomial transform is A007598. The unsigned sequence has G.f. x/((1-2x)(1+x-x^2)) with a(n) = 2*2^n/5-(-1)^n*A000032(n)/5. - _Paul Barry_, Apr 17 2004
%F a(n) = Sum_{k=0..n} (-1)^(n-k)*C(n, k)*Fib(k)^2; a(n) = ((1/2-sqrt(5)/2)^n+(1/2+sqrt(5)/2)^n-2(-2)^n)/5; a(n) = A000032(n)/5-2(-2)^n/5. - _Paul Barry_, Apr 17 2004
%F a(n) = 2^n/5*Sum_{k=0..4} cos(4*Pi*k/5)*cos(2*Pi*k/5)^n. - _Herbert Kociemba_, May 31 2004
%F a(n) = -a(n-1) + 3*a(n-2) + 2*a(n-3) for n>2. - _Paul Curtz_, Mar 09 2008
%p f:= gfun:-rectoproc({a(n) = -a(n-1)+3*a(n-2)+2*a(n-3),
%p a(0)=0,a(1)=1,a(2)=-1},a(n),remember):
%p seq(f(n), n=0..100); # _Robert Israel_, Dec 11 2015
%t CoefficientList[Series[x / ((1 + 2 x) (1 - x - x^2)), {x, 0, 40}], x] (* _Vincenzo Librandi_, Nov 10 2014 *)
%o (Magma) I:=[0,1,-1]; [n le 3 select I[n] else -Self(n-1)+3*Self(n-2)+2*Self(n-3): n in [1..45]]; // _Vincenzo Librandi_, Nov 10 2014
%o (PARI) concat(0, Vec(x/((1+2*x)*(1-x-x^2)) + O(x^100))) \\ _Altug Alkan_, Dec 11 2015
%Y Cf. A000032, A007598, A084178.
%K easy,sign
%O 0,4
%A _Paul Barry_, May 18 2003