%I #67 Sep 02 2024 21:56:12
%S 1,-2,2,0,-4,8,-8,0,16,-32,32,0,-64,128,-128,0,256,-512,512,0,-1024,
%T 2048,-2048,0,4096,-8192,8192,0,-16384,32768,-32768,0,65536,-131072,
%U 131072,0,-262144,524288,-524288,0,1048576,-2097152,2097152,0,-4194304,8388608,-8388608
%N Expansion of 1/(1+2*x+2*x^2).
%C Yet another variation on A009545.
%C Pisano period lengths: 1, 1, 8, 1, 4, 8, 24, 1, 24, 4, 40, 8, 12, 24, 8, 1, 16, 24, 72, 4, ... - _R. J. Mathar_, Aug 10 2012
%H Vincenzo Librandi, <a href="/A108520/b108520.txt">Table of n, a(n) for n = 0..1000</a>
%H Maran van Heesch, <a href="https://research.tue.nl/en/studentTheses/the-multiplicative-complexity-of-symmetric-functions-over-a-field">The multiplicative complexity of symmetric functions over a field with characteristic p</a>, Thesis, 2014.
%H <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (-2,-2).
%F G.f.: 1/(1+2*x+2*x^2).
%F E.g.f.: exp(-x)*(cos(x) - sin(x)).
%F a(n) = -2*(a(n-1) + a(n-2)).
%F a(n) = Sum_{k=0..n} Sum_{j=0..n-k} C(k,j)*C(k,n-j)*(-2)^(n-j). - _Paul Barry_, Mar 09 2006
%F a(n) = -4 * a(n-4). - _Paul Curtz_, Apr 24 2011
%F a(n) = A016116(n+1) * A075553(n+1). - _Paul Curtz_, Apr 25 2011
%F From _Bruno Berselli_, Apr 26 2011: (Start)
%F a(n) = -(-1-i)^(n-1) - (-1+i)^(n-1), where i=sqrt(-1).
%F a(n) = -2*A009116(n-1) for n > 0. (End)
%F Imaginary part of (-1+i)^n, negated real part is A090132. - _Joerg Arndt_, May 13 2011
%F E.g.f.: (cos(x) - sin(x))*exp(-x) = G(0); G(k) = 1 - 2*x/(4*k+1+x*(4*k+1)/(2*(2*k+1) -x -2*(x^2)*(2*k+1)/((x^2) -(2*k+2)*(4*k+3)/G(k+1)))); (continued fraction). - _Sergei N. Gladkovskii_, Nov 26 2011
%F G.f.: G(0)/(2*(1+x)), where G(k) = 1 + 1/(1 - x*(k+1)/(x*(k+2) - 1/G(k+1))); (continued fraction). - _Sergei N. Gladkovskii_, Jun 20 2013
%F a(n) = (-2)^n*hypergeom([1/2-n/2, -n/2], [-n], 2) for n >= 1. - _Peter Luschny_, Dec 17 2015
%p A108520 := n -> `if`(n=0, 1, (-2)^n*hypergeom([1/2-n/2, -n/2], [-n], 2)):
%p seq(simplify(A108520(n)), n=0..46); # _Peter Luschny_, Dec 17 2015
%t CoefficientList[Series[1/(1+2x+2x^2), {x,0,50}], x] (* or *) LinearRecurrence[{-2,-2}, {1,-2}, 50] (* _Harvey P. Dale_, Sep 30 2012 *)
%t Table[-(-1-I)^(n-1) - (-1+I)^(n-1), {n, 0, 50}] (* _Bruno Berselli_, Nov 08 2015 *)
%t Im[(-1+I)^Range[51]] (* _G. C. Greubel_, Apr 24 2023 *)
%o (PARI) a(n)=if(n<0, 0, polcoeff(1/(1+2*x+2*x^2)+x*O(x^n),n))
%o (PARI) a(n)=if(n<1, n==0, -polsym(2+2*x+x^2,n-1)[n])
%o (Magma) [n le 2 select n*(-1)^(n-1) else -2*(Self(n-1)+Self(n-2)): n in [1..47]]; // _Bruno Berselli_, Apr 26 2011
%o (PARI) vector(66,n,imag((-1+I)^n)) /* _Joerg Arndt_, May 13 2011 */
%o (SageMath) [imag((-1+I)^(n+1)) for n in range(51)] # _G. C. Greubel_, Apr 24 2023
%Y a(n) = (-1)^n * A099087(n). a(n) = -A084102(n) if n>0.
%Y Cf. A009116, A009545, A016116, A075553, A084102, A099087.
%K sign,easy
%O 0,2
%A _Michael Somos_, Jun 07 2005