A077985 Expansion of 1/(1 + 2*x - x^2).
1, -2, 5, -12, 29, -70, 169, -408, 985, -2378, 5741, -13860, 33461, -80782, 195025, -470832, 1136689, -2744210, 6625109, -15994428, 38613965, -93222358, 225058681, -543339720, 1311738121, -3166815962, 7645370045, -18457556052, 44560482149, -107578520350, 259717522849
Offset: 0
Examples
G.f. = 1 - 2*x + 5*x^2 - 12*x^3 + 29*x^4 - 70*x^5 + 169*x^6 - 408*x^7 + ...
Links
- Vincenzo Librandi, Table of n, a(n) for n = 0..1000
- Milan Janjic, Hessenberg Matrices and Integer Sequences, J. Int. Seq. 13 (2010) # 10.7.8.
- Tanya Khovanova, Recursive Sequences
- Wikipedia, Lucas sequence
- Index entries for linear recurrences with constant coefficients, signature (-2,1).
- Index to Lucas sequences
Crossrefs
Programs
-
Magma
I:=[1,-2]; [n le 2 select I[n] else -2*Self(n-1)+Self(n-2): n in [1..35]]; // Vincenzo Librandi, Jan 21 2017
-
Mathematica
PSE[a_,b_,n_]:=Join[{1,x=a,y=b},Table[z=Floor[y^2/x+1/2];x=y;y=z,{n}]];A077985=PSE[-2,5,50] (* Vladimir Joseph Stephan Orlovsky, Mar 26 2011 *) LinearRecurrence[{-2,1},{1,-2},40] (* Harvey P. Dale, Jun 04 2012 *) CoefficientList[Series[1/(1 + 2 x/(1 + x/(2 - x))), {x, 0, 30}], x] (* Vincenzo Librandi, Jan 21 2017 *)
-
PARI
Vec(1/(1+2*x-x^2)+O(x^99)) \\ Charles R Greathouse IV, Sep 23 2012
-
PARI
{a(n) = if( n<-1, (-1)^n*a(-2-n), polcoeff( 1 / (1 + 2*x - x^2) + x * O(x^n), n))}; /* Michael Somos, Jan 20 2017 */
-
PARI
{a(n) = - imag((-1 - quadgen(8))^(n+1))}; /* Michael Somos, Jan 20 2017 */
-
Sage
taylor( x/(1 + 2*x - x^2) ,x,0,31) # Zerinvary Lajos, May 29 2009
Formula
a(n) = (-1)^n * A000129(n+1). - M. F. Hasler, Oct 05 2008
a(0)=1, a(1)=-2, a(n) = -2*a(n-1) + a(n-2) for n>1. - Philippe Deléham, Sep 19 2009
G.f.: 1/(2+Q(0)), where Q(k)= 3*x - 1 + x*k + x*(1-x)*(k+1)/Q(k+1); (continued fraction). - Sergei N. Gladkovskii, May 05 2013
G.f.: Q(0)/(2+2*x), where Q(k)= 1 + 1/(1 - x*(2*k-1)/( x*(2*k+1) + 1/Q(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Aug 10 2013
G.f.: Q(0)/2, where Q(k) = 1 + 1/(1 - x*(4*k+2 - x )/( x*(4*k+4 - x) - 1/Q(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Sep 09 2013
G.f.: 1 / (1 + 2*x / (1 + x / (2 - x))). - Michael Somos, Jan 20 2017
a(n) = (-1)^n * a(-2-n) for all n in Z. - Michael Somos, Jan 20 2017
a(n) = (-(-1-sqrt(2))^(1+n) + (-1+sqrt(2))^(1+n)) / (2*sqrt(2)). - Colin Barker, Jan 21 2017
E.g.f.: exp(-x)*(2*cosh(sqrt(2)*x) - sqrt(2)*sinh(sqrt(2)*x))/2. - Stefano Spezia, Feb 01 2023
Comments