A162852 a(n) = 3*a(n-2) for n > 2; a(1) = 3, a(2) = -1.
3, -1, 9, -3, 27, -9, 81, -27, 243, -81, 729, -243, 2187, -729, 6561, -2187, 19683, -6561, 59049, -19683, 177147, -59049, 531441, -177147, 1594323, -531441, 4782969, -1594323, 14348907, -4782969, 43046721, -14348907, 129140163
Offset: 1
Keywords
Links
- G. C. Greubel, Table of n, a(n) for n = 1..1000
- Index entries for linear recurrences with constant coefficients, signature (0,3).
Programs
-
GAP
a:=[3,-1];; for n in [3..25] do a[n]:=3*a[n-2]; od; a; # Muniru A Asiru, Oct 25 2018
-
Magma
[ n le 2 select 7-4*n else 3*Self(n-2): n in [1..34] ];
-
Maple
seq(op([3^n,-3^(n-1)]),n=1..18); # Muniru A Asiru, Oct 25 2018
-
Mathematica
Rest[CoefficientList[Series[x*(3-x)/(1-3*x^2), {x, 0, 40}], x]] (* or *) LinearRecurrence[{0,3}, {3,-1}, 40] (* G. C. Greubel, Oct 24 2018 *)
-
PARI
x='x+O('x^40); Vec(x*(3-x)/(1-3*x^2)) \\ G. C. Greubel, Oct 24 2018
Formula
a(n) = ((4-5*(-1)^n)*3^(1/4*(2*n-1+(-1)^n)))/3.
G.f.: x*(3-x)/(1-3*x^2). [corrected by Klaus Brockhaus, Sep 18 2009]
E.g.f.: (1 - cosh(sqrt(3)*x) + 3*sqrt(3)*sinh(sqrt(3)*x))/3. - G. C. Greubel, Oct 24 2018
Comments