A099780 a(n) = Sum_{k=0..floor(n/3)} C(n-k, 2*k) * 2^k*3^(n-3*k).
1, 3, 9, 29, 99, 351, 1273, 4677, 17307, 64295, 239361, 892125, 3327091, 12412143, 46313289, 172824629, 644952459, 2406919671, 8982595153, 33523198797, 125109675747, 466914455615, 1742546049561, 6503265548325, 24270507755131, 90578748694983, 338044453470369
Offset: 0
Links
- Colin Barker, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (6,-9,2).
Programs
-
GAP
a:=[1,3,9];; for n in [4..30] do a[n]:=6*a[n-1]-9*a[n-2]+2*a[n-3]; od; a; # G. C. Greubel, Sep 04 2019
-
Magma
I:=[1,3,9]; [n le 3 select I[n] else 6*Self(n-1) - 9*Self(n-2) + 2*Self(n-3): n in [1..30]]; // G. C. Greubel, Sep 04 2019
-
Maple
seq(coeff(series((1-3*x)/((1-3*x)^2 -2*x^3), x, n+1), x, n), n = 0..30); # G. C. Greubel, Sep 04 2019
-
Mathematica
LinearRecurrence[{6,-9,2},{1,3,9},30] (* Harvey P. Dale, Nov 30 2015 *)
-
PARI
Vec((1-3*x) / ((1-3*x)^2-2*x^3) + O(x^30)) \\ Colin Barker, Feb 05 2017
-
PARI
a(n) = sum(k=0, n\3, binomial(n-k, 2*k) * 2^k*3^(n-3*k)); \\ Michel Marcus, Feb 05 2017
-
Sage
def A099780_list(prec): P.
= PowerSeriesRing(ZZ, prec) return P((1-3*x)/((1-3*x)^2 -2*x^3)).list() A099780_list(30) # G. C. Greubel, Sep 04 2019
Formula
G.f.: (1-3*x)/((1-3*x)^2 - 2*x^3).
a(n) = 6*a(n-1) - 9*a(n-2) + 2*a(n-3).
a(n) = A001834(n)/3 + 2^(n+1)/3. - R. J. Mathar, Sep 21 2012
a(n) = (2^(2+n) - (2-sqrt(3))^n*(-1+sqrt(3)) + (1+sqrt(3))*(2+sqrt(3))^n) / 6. - Colin Barker, Feb 05 2017
E.g.f.: (1/3)*exp(2*x)*(2 + cosh(sqrt(3)*x) + sqrt(3)*sinh(sqrt(3)*x)). - Stefano Spezia, Sep 04 2019
Comments