%I #179 Aug 04 2024 01:26:29
%S 0,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,0,16777216,33554432
%N Expansion of e.g.f. sin(x)*exp(x).
%C Also first of the two associated sequences a(n) and b(n) built from a(0)=0 and b(0)=1 with the formulas a(n) = a(n-1) + b(n-1) and b(n) = -a(n-1) + b(n-1). The initial terms of the second sequence b(n) are 1, 1, 0, -2, -4, -4, 0, 8, 16, 16, 0, -32, -64, -64, 0, 128, 256, ... The points Mn(a(n)+b(n)*I) of the complex plane are located on the spiral logarithmic rho = 2*(1/2)^(2*theta)/Pi) and on the straight lines drawn from the origin with slopes: infinity, 1/2, 0, -1/2. - Philippe LALLOUET (philip.lallouet(AT)wanadoo.fr), Jun 30 2007
%C A000225: (1, 3, 7, 15, 31, ...) = 2^n - 1 = INVERT transform of A009545 starting (1, 2, 2, 0, -4, -8, ...). (Cf. comments in A144081). - _Gary W. Adamson_, Sep 10 2008
%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
%C The variant 0, 1, -2, 2, 0, -4, 8, -8, 0, 16, -32, 32, 0, -64, (with different signs) is the Lucas U(-2,2) sequence. - _R. J. Mathar_, Jan 08 2013
%C (1+i)^n = A146559(n) + a(n)*i where i = sqrt(-1). - _Philippe Deléham_, Feb 13 2013
%C This is the Lucas U(2,2) sequence. - _Raphie Frank_, Nov 28 2015
%C {A146559, A009545} are the difference analogs of {cos(x),sin(x)} (cf. [Shevelev] link). - _Vladimir Shevelev_, Jun 08 2017
%H N. J. A. Sloane, <a href="/A009545/b009545.txt">Table of n, a(n) for n = 0..2000</a>, Apr 09 2016 (first 100 terms from T. D. Noe)
%H Paul Barry, <a href="http://www.cs.uwaterloo.ca/journals/JIS/VOL8/Barry/barry84.html">A Catalan Transform and Related Transformations on Integer Sequences</a>, Journal of Integer Sequences, Vol. 8 (2005), Article 05.4.5.
%H Paul Barry, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL9/Barry/barry91.html">On Integer-Sequence-Based Constructions of Generalized Pascal Triangles</a>, Journal of Integer Sequences, Vol. 9 (2006), Article 06.2.4.
%H A. F. Horadam, <a href="http://www.fq.math.ca/Scanned/5-5/horadam.pdf">Special properties of the sequence W_n(a,b; p,q)</a>, Fib. Quart., 5.5 (1967), 424-434. Case n->n+1, a=0,b=1; p=2, q=-2.
%H Wolfdieter Lang, <a href="http://www.fq.math.ca/Scanned/38-5/lang.pdf">On polynomials related to powers of the generating function of Catalan's numbers</a>, Fib. Quart. 38 (2000) 408-419. Eqs. (38) and (45), lhs, m=2.
%H Vladimir Shevelev, <a href="https://arxiv.org/abs/1706.01454">Combinatorial identities generated by difference analogs of hyperbolic and trigonometric functions of order n</a>, arXiv:1706.01454 [math.CO], 2017.
%H N. J. A. Sloane, <a href="/A066321/a066321.txt">Table of n, (I-1)^n for n = 0..100</a>
%H Wikipedia, <a href="http://en.wikipedia.org/wiki/Lucas_sequence#Specific_names">Lucas sequence</a>.
%H <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (2,-2).
%H <a href="/index/Ch#Cheby">Index entries for sequences related to Chebyshev polynomials</a>
%H <a href="/index/Lu#Lucas">Index entries for Lucas sequences</a>
%F a(0)=0; a(1)=1; a(2)=2; a(3)=2; a(n) = -4*a(n-4), n>3. - Larry Reeves (larryr(AT)acm.org), Aug 24 2000
%F Imaginary part of (1+i)^n. - _Marc LeBrun_
%F G.f.: x/(1 - 2*x + 2*x^2).
%F E.g.f.: sin(x)*exp(x).
%F a(n) = S(n-1, sqrt(2))*(sqrt(2))^(n-1) with S(n, x)= U(n, x/2) Chebyshev's polynomials of the 2nd kind, Cf. A049310, S(-1, x) := 0.
%F a(n) = ((1+i)^n - (1-i)^n)/(2*i) = 2*a(n-1) - 2*a(n-2) (with a(0)=0 and a(1)=1). - _Henry Bottomley_, May 10 2001
%F a(n) = (1+i)^(n-2) + (1-i)^(n-2). - _Benoit Cloitre_, Oct 28 2002
%F a(n) = Sum_{k=0..n-1} (-1)^floor(k/2)*binomial(n-1, k). - _Benoit Cloitre_, Jan 31 2003
%F a(n) = 2^(n/2)sin(Pi*n/4). - _Paul Barry_, Sep 17 2003
%F a(n) = Sum_{k=0..floor(n/2)} binomial(n, 2*k+1)*(-1)^k. - _Paul Barry_, Sep 20 2003
%F a(n+1) = Sum_{k=0..n} 2^k*A109466(n,k). - _Philippe Deléham_, Nov 13 2006
%F a(n) = 2*((1/2)^(2*theta(n)/Pi))*cos(theta(n)) where theta(4*p+1) = p*Pi + Pi/2, theta(4*p+2) = p*Pi + Pi/4, theta(4*p+3) = p*Pi - Pi/4, theta(4*p+4) = p*Pi - Pi/2, or a(0)=0, a(1)=1, a(2)=2, a(3)=2, and for n>3 a(n)=-4*a(n-4). Same formulas for the second sequence replacing cosines with sines. For example: a(0) = 0, b(0) = 1; a(1) = 0+1 = 1, b(1) = -0+1 = 1; a(2) = 1+1 = 2, b(2) = -1+1 = 0; a(3) = 2+0 = 2, b(3) = -2+0 = -2. - Philippe LALLOUET (philip.lallouet(AT)wanadoo.fr), Jun 30 2007
%F a(n) = 4*a(n-1) - 6*a(n-2) + 4*a(n-3), n > 3, which implies the sequence is identical to its fourth differences. Binomial transform of 0, 1, 0, -1. - _Paul Curtz_, Dec 21 2007
%F Logarithm g.f. arctan(x/(1-x)) = Sum_{n>0} a(n)/n*x^n. - _Vladimir Kruchinin_, Aug 11 2010
%F a(n) = A046978(n) * A016116(n). - _Paul Curtz_, Apr 24 2011
%F E.g.f.: exp(x) * sin(x) = x + x^2/(G(0)-x); G(k) = 2k + 1 + x - x*(2k+1)/(4k+3+x+x^2*(4k+3)/( (2k+2)*(4k+5) - x^2 - x*(2k+2)*(4k+5)/G(k+1))); (continued fraction). - _Sergei N. Gladkovskii_, Nov 15 2011
%F a(n) = Im( (1+i)^n ) where i=sqrt(-1). - Stanislav Sykora, Jun 11 2012
%F G.f.: x*U(0) where U(k) = 1 + x*(k+3) - x*(k+1)/U(k+1); (continued fraction, 1-step). - _Sergei N. Gladkovskii_, Oct 10 2012
%F G.f.: G(0)*x/(2*(1-x)), where G(k) = 1 + 1/(1 - x*(k+1)/(x*(k+2) + 1/G(k+1))); (continued fraction). - _Sergei N. Gladkovskii_, May 25 2013
%F G.f.: x + x^2*W(0), where W(k) = 1 + 1/(1 - x*(k+1)/( x*(k+2) + 1/W(k+1) )); (continued fraction). - _Sergei N. Gladkovskii_, Aug 28 2013
%F G.f.: Q(0)*x/2, where Q(k) = 1 + 1/(1 - x*(4*k+2 - 2*x)/( x*(4*k+4 - 2*x) + 1/Q(k+1) )); (continued fraction). - _Sergei N. Gladkovskii_, Sep 06 2013
%F a(n) = (A^n - B^n)/(A - B), where A = 1 + i and B = 1 - i; A and B are solutions of x^2 - 2*x + 2 = 0. - _Raphie Frank_, Nov 28 2015
%F a(n) = 2^(n-1)*hypergeom([1-n/2, (1-n)/2], [1-n], 2) for n >= 2. - _Peter Luschny_, Dec 17 2015
%F a(k+m) = a(k)*A146559(m) + a(m)*A146559(k). - _Vladimir Shevelev_, Jun 08 2017
%p t1 := sum(n*x^n, n=0..100): F := series(t1/(1+x*t1), x, 100): for i from 0 to 50 do printf(`%d, `, coeff(F, x, i)) od: # _Zerinvary Lajos_, Mar 22 2009
%p G(x):=exp(x)*sin(x): f[0]:=G(x): for n from 1 to 54 do f[n]:=diff(f[n-1],x) od: x:=0: seq(f[n],n=0..50 ); # _Zerinvary Lajos_, Apr 05 2009
%p A009545 := n -> `if`(n<2, n, 2^(n-1)*hypergeom([1-n/2, (1-n)/2], [1-n], 2)):
%p seq(simplify(A009545(n)), n=0..50); # _Peter Luschny_, Dec 17 2015
%t nn=104; Range[0,nn-1]! CoefficientList[Series[Sin[x]Exp[x], {x,0,nn}], x] (* _T. D. Noe_, May 26 2007 *)
%t Join[{a=0,b=1},Table[c=2*b-2*a;a=b;b=c,{n,100}]] (* _Vladimir Joseph Stephan Orlovsky_, Jan 17 2011 *)
%t f[n_] := (1 + I)^(n - 2) + (1 - I)^(n - 2); Array[f, 51, 0] (* _Robert G. Wilson v_, May 30 2011 *)
%t LinearRecurrence[{2,-2},{0,1},110] (* _Harvey P. Dale_, Oct 13 2011 *)
%o (Sage) [lucas_number1(n,2,2) for n in range(0, 51)] # _Zerinvary Lajos_, Apr 23 2009
%o (PARI) x='x+O('x^66); Vec(serlaplace(exp(x)*sin(x))) /* _Joerg Arndt_, Apr 24 2011 */
%o (PARI) x='x+O('x^100); concat(0, Vec(x/(1-2*x+2*x^2))) \\ _Altug Alkan_, Dec 04 2015
%o (Sage)
%o def A146559():
%o x, y = 0, -1
%o while True:
%o yield x
%o x, y = x - y, x + y
%o a = A146559(); [next(a) for i in range(40)] # _Peter Luschny_, Jul 11 2013
%o (Magma) I:=[0,1,2,2]; [n le 4 select I[n] else -4*Self(n-4): n in [1..60]]; // _Vincenzo Librandi_, Nov 29 2015
%o (Python)
%o def A009545(n): return ((0, 1, 2, 2)[n&3]<<((n>>1)&-2))*(-1 if n&4 else 1) # _Chai Wah Wu_, Feb 16 2024
%Y Cf. A009116. For minor variants of this sequence see A108520, A084102, A099087.
%Y a(2*n) = A056594(n)*2^n, n >= 1, a(2*n+1) = A057077(n)*2^n.
%Y This is the next term in the sequence A015518, A002605, A000129, A000079, A001477.
%Y Cf. A000225, A144081. - _Gary W. Adamson_, Sep 10 2008
%Y Cf. A146559.
%K sign,easy,nice
%O 0,3
%A _R. H. Hardin_
%E Extended with signs by _Olivier Gérard_, Mar 15 1997
%E More terms from Larry Reeves (larryr(AT)acm.org), Aug 24 2000
%E Definition corrected by _Joerg Arndt_, Apr 24 2011