A127357 Expansion of 1/(1 - 2*x + 9*x^2).
1, 2, -5, -28, -11, 230, 559, -952, -6935, -5302, 51811, 151340, -163619, -1689298, -1906025, 11391632, 39937489, -22649710, -404736821, -605626252, 2431378885, 10313394038, -1255621889
Offset: 0
Links
- G. C. Greubel, Table of n, a(n) for n = 0..1000
- Wikipedia, Lucas sequence
- Index entries for linear recurrences with constant coefficients, signature (2,-9).
Programs
-
GAP
a:=[1,2];; for n in [3..25] do a[n]:=2*a[n-1]-9*a[n-2]; od; a; # Muniru A Asiru, Oct 23 2018
-
Magma
m:=23; R
:=PowerSeriesRing(Integers(), m); Coefficients(R!(1/(1-2*x+9*x^2))); // Bruno Berselli, Jul 01 2011 -
Magma
[3^n*Evaluate(ChebyshevU(n+1),1/3): n in [0..50]]; // G. C. Greubel, Jan 02 2024
-
Maple
c := 2*sqrt(2): g := exp(x)*(sin(c*x)+c*cos(c*x))/c: ser := series(g,x,32): seq(n!*coeff(ser,x,n), n=0..22); # Peter Luschny, Oct 19 2016
-
Mathematica
RootReduce@Table[3^n (Cos[n ArcTan[2 Sqrt[2]]] + Sin[n ArcTan[2 Sqrt[2]]] Sqrt[2]/4), {n, 0, 20}] (* Vladimir Reshetnikov, Oct 15 2016 *) CoefficientList[Series[1/(1-2x+9x^2),{x,0,40}],x] (* or *) LinearRecurrence[ {2,-9},{1,2},40] (* Harvey P. Dale, Mar 15 2022 *) Table[3^n*ChebyshevU[n, 1/3], {n,0,40}] (* G. C. Greubel, Jan 02 2024 *)
-
Maxima
makelist(coeff(taylor(1/(1-2*x+9*x^2), x, 0, n), x, n), n, 0, 22); /* Bruno Berselli, Jul 01 2011 */
-
PARI
Vec(1/(1-2*x+9*x^2)+O(x^99)) \\ Charles R Greathouse IV, Sep 26 2012
-
Sage
[lucas_number1(n,2,9) for n in range(1, 24)] # Zerinvary Lajos, Apr 23 2009
-
SageMath
[3^n*chebyshev_U(n,1/3) for n in range(41)] # G. C. Greubel, Jan 02 2024
Formula
a(n) = Sum_{k=0..n} binomial(n-k,k)*2^(n-2*k)*(-9)^k.
a(n) = 2*a(n-1) - 9*a(n-2) for n >= 2. - Vincenzo Librandi, Mar 22 2011
a(n) = ((1-2*sqrt(2)*i)^n-(1+2*sqrt(2)*i)^n)*i/(4*sqrt(2)), where i=sqrt(-1). - Bruno Berselli, Jul 01 2011
From Vladimir Reshetnikov, Oct 15 2016: (Start)
a(n) = 3^n*(cos(n*theta) + sin(n*theta)*sqrt(2)/4), theta = arctan(2*sqrt(2)).
E.g.f.: exp(x)*(cos(2*sqrt(2)*x) + sin(2*sqrt(2)*x)*sqrt(2)/4). (End)
a(n) = 2^n*Product_{k=1..n}(1 + 3*cos(k*Pi/(n+1))). - Peter Luschny, Nov 28 2019
From G. C. Greubel, Jan 02 2024: (Start)
a(n) = (-1)^n * A025170(n).
a(n) = 3^n * ChebyshevU(n, 1/3). (End)
Comments