%I
%S 1,-1,0,2,-4,4,0,-8,16,-16,0,32,-64,64,0,-128,256,-256,0,512,-1024,
%T 1024,0,-2048,4096,-4096,0,8192,-16384,16384,0,-32768,65536,-65536,0,
%U 131072,-262144,262144,0,-524288,1048576,-1048576,0,2097152,-4194304
%N Expansion of e.g.f. cos(x) / exp(x).
%C Apart from signs, generated by 1,1 position of H_2^n=[1,1;-1,1]^n; and a(n)=2^(n/2)*cos(Pi*n/2). - _Paul Barry_, Feb 18 2004
%C Equals binomial transform of "Period 4, repeat [1, 0, -1, 0]". - _Gary W. Adamson_, Mar 25 2009
%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 N. J. A. Sloane, <a href="/A009116/b009116.txt">Table of n, a(n) for n = 0..2000</a>
%H Beata Bajorska-Harapińska, Barbara Smoleń, Roman Wituła, <a href="https://doi.org/10.1007/s00006-019-0969-9">On Quaternion Equivalents for Quasi-Fibonacci Numbers, Shortly Quaternaccis</a>, Advances in Applied Clifford Algebras (2019) Vol. 29, 54.
%H N. J. A. Sloane, <a href="/A066321/a066321.txt">Table of n, (I-1)^n for n=0..100</a>
%H <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (-2,-2).
%F Real part of (-1-i)^n. See A009545 for imaginary part. - _Marc LeBrun_
%F a(n) = -2 * (a(n-1) + a(n-2)), a(0) = 1, a(1) = -1 - _Michael Somos_, Nov 17 2002
%F Sum_{j=0..[n/2]} (-1)^j*binomial(n, 2*j).
%F G.f.: (1 + x) / (1 + 2*x + 2*x^2).
%F E.g.f.: cos(x) / exp(x).
%F a(n) = Sum_{k, 0<=k<=n}(-1)^k*A098158(n,k). - _Philippe Deléham_, Dec 04 2006
%F a(n)*(-1)^n=A099087(n)-A099087(n-1). - _R. J. Mathar_, Nov 18 2007
%F a(n) = 1/2*[(-1-I)^n+(-1+I)^n], with n>=0 and I=sqrt(-1). - _Paolo P. Lava_, Nov 21 2008
%F a(n) = (-1)^n*A146559(n). - _Philippe Deléham_, Dec 01 2008
%F a(n) = -4*a(n-4); a(n)=A016116(n) * A075553(n+6). - _Paul Curtz_, Jul 22 2011
%F E.g.f.: cos(x)/exp(x) = 1-x/(G(0)+1); G(k) = 4k+1-x+(x^2)*(4k+1)/((2k+1)*(4k+3)-(x^2)+x*(2k+1)*(4k+3)/( 2k+2-x+x*(2k+2)/G(k+1))); (continued fraction). - _Sergei N. Gladkovskii_, Nov 24 2011
%F G.f.: G(0)/2, 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) = (-1)^n*2^(n/2)*cos(n*Pi/4). - _Nordine Fahssi_, Dec 18 2013
%F a(n) = (-1)^floor((n + 1)/2)*2^(n-1)*H(n, n mod 2, 1/2) for n >= 3 where H(n, a, b) = hypergeom([a - n/2, b - n/2], [1 - n], 2). - _Peter Luschny_, Sep 03 2019
%e 1 - x + 2*x^3 - 4*x^4 + 4*x^5 - 8*x^7 + 16*x^8 - 16*x^9 + 32*x^11 - 64*x^12 + ...
%p A009116 := n->add((-1)^j*binomial(n,2*j),j=0..floor(n/2));
%t n = 50; (* n = 2 mod 4 *) (CoefficientList[ Series[ Cos[x]/Exp[x], {x, 0, n}], x]* Table[k!, {k, 0, n - 1}] )[[1 ;; 45]] (* _Jean-François Alcover_, May 18 2011 *)
%t Table[(1/2)*((-1 - I)^n + (-1 + I)^n), {n, 0, 50}] (* _Jean-François Alcover_, Jan 31 2018, after _Paolo P. Lava_ *)
%o (PARI) {a(n) = if( n<0, 0, polcoeff( (1 + x) / (1 + 2*x + 2*x^2) + x * O(x^n), n))} /* _Michael Somos_, Nov 17 2002 */
%o (MAGMA) m:=50; R<x>:=PowerSeriesRing(Rationals(), m); b:=Coefficients(R!(Cos(x)/Exp(x))); [Factorial(n-1)*b[n]: n in [1..m]]; // _G. C. Greubel_, Jul 22 2018
%Y Cf. A009545, A099087, A146559, A098158, A075553, A090132.
%Y (With different signs) row sums of triangle A104597.
%Y Also related to A066321 and A271472.
%K sign,easy,nice
%O 0,4
%A _R. H. Hardin_
%E Extended with signs by _Olivier Gérard_, Mar 15 1997
%E Definition corrected by _Joerg Arndt_, Apr 29 2011
|