login
a(n) = -2*a(n-1) + a(n-2) for n > 2, with a(0) = a(1) = 1, a(2) = 0.
5

%I #54 Oct 31 2024 18:40:27

%S 1,1,0,1,-2,5,-12,29,-70,169,-408,985,-2378,5741,-13860,33461,-80782,

%T 195025,-470832,1136689,-2744210,6625109,-15994428,38613965,-93222358,

%U 225058681,-543339720,1311738121,-3166815962,7645370045,-18457556052,44560482149

%N a(n) = -2*a(n-1) + a(n-2) for n > 2, with a(0) = a(1) = 1, a(2) = 0.

%C BINOMIAL transform is A052955.

%C Essentially the same as A000129, A069306, A048624, A215928, A077985, and A176981. - _R. J. Mathar_, Sep 08 2013

%H Vincenzo Librandi, <a href="/A215936/b215936.txt">Table of n, a(n) for n = 0..1000</a>

%H M. C. Firengiz and A. Dil, <a href="http://www.nntdm.net/papers/nntdm-20/NNTDM-20-4-21-32.pdf">Generalized Euler-Seidel method for second order recurrence relations</a>, Notes on Number Theory and Discrete Mathematics, Vol. 20, 2014, No. 4, 21-32.

%H <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (-2,1).

%F G.f.: 1 / (1 - x / (1 + x / (1 + x / (1 + x)))) = (1 + 3*x + x^2) / (1 + 2*x - x^2).

%F a(n + 3) = A077985(n). a(n) * a(n+2) - a(n+1)^2 = -(-1)^n.

%F a(2*n + 1) = A001653(n). a(2*n + 2) = -A001542(n).

%F a(n) = Sum_{k=0..n} A147746(n,k)*(-1)^(n-k). - _Philippe Deléham_, Aug 30 2012

%F G.f.: 1 + x + x^2/(1-x) - G(0)*x^2 /(2-2*x), where G(k)= 1 + 1/(1 - x*(2*k-1)/(x*(2*k+1) + 1/G(k+1) )); (continued fraction). - _Sergei N. Gladkovskii_, Aug 10 2013

%F a(n) = (-1)^n a(1-n) = A000129(-1-n) if n < 0. a(n-2) = 2*a(n-1) + a(n) if n<1 or n>2. - _Michael Somos_, Mar 19 2019

%F E.g.f.: exp(-x)*(4*cosh(sqrt(2)*x) + 3*sqrt(2)*sinh(sqrt(2)*x))/2 - 1. - _Stefano Spezia_, Oct 31 2024

%e G.f. = 1 + x + x^3 - 2*x^4 + 5*x^5 - 12*x^6 + 29*x^7 - 70*x^8 + 169*x^9 - 408*x^10 + ...

%t CoefficientList[Series[(1 + 3 x + x^2)/(1 + 2 x - x^2), {x, 0, 40}], x] (* _Vincenzo Librandi_, Sep 09 2013 *)

%t a[ n_] := With[ {m = If[ n < 1, 1 - n, n], s = If[ n < 1, (-1)^n, 1]}, s SeriesCoefficient[ x (1 + 2 x) / (1 + 2 x - x^2), {x, 0, m}]]; (* _Michael Somos_, Mar 19 2019 *)

%o (PARI) {a(n) = my(m=n, s=1); if(n<1, m=1-n; s=(-1)^n); s * polcoeff( x * (1 + 2*x) / (1 + 2*x - x^2) + x * O(x^m), m)}; /* _Michael Somos_, Mar 19 2019 */

%o (Magma) [1,1] cat [n le 2 select (n-1) else -2*Self(n-1)+Self(n-2): n in [1..35] ]; // _Vincenzo Librandi_, Sep 09 2013

%Y Cf. A001542, A001653, A052955, A077985.

%K sign,easy,changed

%O 0,5

%A _Michael Somos_, Aug 28 2012