A123877 Expansion of (1+2*x)/(1+3*x+3*x^2).
1, -1, 0, 3, -9, 18, -27, 27, 0, -81, 243, -486, 729, -729, 0, 2187, -6561, 13122, -19683, 19683, 0, -59049, 177147, -354294, 531441, -531441, 0, 1594323, -4782969, 9565938, -14348907, 14348907, 0, -43046721
Offset: 0
Links
- G. C. Greubel, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (-3,-3).
Crossrefs
Cf. A123876.
Programs
-
GAP
a:=[1,-1];; for n in [3..40] do a[n]:=-3*(a[n-1]+a[n-2]); od; a; # G. C. Greubel, Aug 08 2019
-
Magma
I:=[1,-1]; [n le 2 select I[n] else -3*(Self(n-1)+Self(n-2)): n in [1..30]]; // G. C. Greubel, Aug 08 2019
-
Maple
seq(coeff(series((1+2*x)/(1+3*x+3*x^2), x, n+1), x, n), n = 0..40); # G. C. Greubel, Aug 08 2019
-
Mathematica
CoefficientList[Series[(1+2x)/(1+3x+3x^2),{x,0,40}],x] (* or *) LinearRecurrence[{-3,-3},{1,-1},40] (* Harvey P. Dale, Dec 17 2017 *)
-
PARI
my(x='x+O('x^40)); Vec((1+2*x)/(1+3*x+3*x^2)) \\ G. C. Greubel, Aug 08 2019
-
Sage
def A123877_list(prec): P.
= PowerSeriesRing(ZZ, prec) return P((1+2*x)/(1+3*x+3*x^2)).list() A123877_list(40) # G. C. Greubel, Aug 08 2019
Formula
a(n) = Sum_{k=0..n} (-1)^(n-k)*C(n,k)*(cos(2*Pi*k/3) + sin(2*Pi*k/3)/sqrt(3)).
G.f.: G(0)*(1+2*x)/(2+3*x), where G(k)= 1 + 1/(1 - x*(k+3)/(x*(k+4) - 2/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, Jun 16 2013
E.g.f.: (1/3)*exp(-3*x/2)*(3*cos((sqrt(3)*x)/2) + sqrt(3)*sin((sqrt(3)*x)/2)). - Stefano Spezia, Aug 08 2019
Comments