login
a(n) = 4*a(n-2) - a(n-1), with a(0)=1, a(1)=-2.
1

%I #33 Jan 03 2024 08:43:32

%S 1,-2,6,-14,38,-94,246,-622,1606,-4094,10518,-26894,68966,-176542,

%T 452406,-1158574,2968198,-7602494,19475286,-49885262,127786406,

%U -327327454,838473078,-2147782894,5501675206,-14092806782,36099507606,-92470734734

%N a(n) = 4*a(n-2) - a(n-1), with a(0)=1, a(1)=-2.

%H G. C. Greubel, <a href="/A122112/b122112.txt">Table of n, a(n) for n = 0..1000</a>

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

%F a(n) = (-1)^n * A026597(n).

%F a(n) = Sum_{k=0..n} (-2)^(n-k) * A055830(n,k).

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

%F a(n) = (-2*i)^n*( ChebyshevU(n, -i/4) - (i/2)*ChebyshevU(n-1, -i/4) ). - _G. C. Greubel_, Dec 23 2021

%F E.g.f.: exp(-x/2)*(17*cosh(sqrt(17)*x/2) - 3*sqrt(17)*sinh(sqrt(17)*x/2))/17. - _Stefano Spezia_, Apr 03 2023

%p seq(coeff(series((1-x)/(1+x-4*x^2), x, n+1), x, n), n = 0..30); # _G. C. Greubel_, Oct 02 2019

%t LinearRecurrence[{-1,4}, {1,-2}, 30] (* _G. C. Greubel_, Oct 02 2019 *)

%o (PARI) my(x='x+O('x^30)); Vec((1-x)/(1+x-4*x^2)) \\ _G. C. Greubel_, Oct 02 2019

%o (Magma) R<x>:=PowerSeriesRing(Integers(), 30); Coefficients(R!( (1-x)/(1+x-4*x^2) )); // _G. C. Greubel_, Oct 02 2019

%o (Sage)

%o def A122112_list(prec):

%o P.<x> = PowerSeriesRing(ZZ, prec)

%o return P((1-x)/(1+x-4*x^2)).list()

%o A122112_list(30) # _G. C. Greubel_, Oct 02 2019

%o (GAP) a:=[1,-2];; for n in [3..30] do a[n]:=-a[n-1]+4*a[n-2]; od; a; # _G. C. Greubel_, Oct 02 2019

%Y Cf. A026597, A055830.

%K sign,easy

%O 0,2

%A _Philippe Deléham_, Oct 18 2006

%E Corrected by _T. D. Noe_, Nov 07 2006