A122038 a(n) = 1*3^(3*n) + 2*3^(2*n) - 3*3^(1*n).
36, 864, 21060, 544320, 14466276, 388481184, 10469912580, 282515610240, 7626372266916, 205898105486304, 5559123328143300, 150095200154477760, 4052560236745849956, 109419034885082920224, 2954313118333054841220
Offset: 1
Links
- G. C. Greubel, Table of n, a(n) for n = 1..690
- Index entries for linear recurrences with constant coefficients, signature (39,-351,729).
Crossrefs
Cf. A122041.
Programs
-
GAP
a:=[36,864,21060];; for n in [4..20] do a[n]:=39*a[n-1] -351*a[n-2] +729a[n-3]; od; a; # G. C. Greubel, Oct 04 2019
-
Magma
I:=[36,864,21060]; [n le 3 select I[n] else 39*Self(n-1) - 351*Self(n-2) +729*Self(n-3): n in [1..20]]; // G. C. Greubel, Oct 04 2019
-
Maple
A122038:=n->1*3^(3*n)+2*3^(2*n)-3*3^(1*n): seq(A122038(n), n=1..20); # Wesley Ivan Hurt, Apr 23 2017
-
Mathematica
LinearRecurrence[{39,-351,729}, {36,864,21060}, 20] (* G. C. Greubel, Oct 04 2019 *) CoefficientList[Series[36x (1-15x)/((1-3x)(1-9x)(1-27x)),{x,0,20}],x] (* Harvey P. Dale, Aug 16 2021 *)
-
PARI
for(n=1,20,print1(3^(3*n)+2*3^(2*n)-3^(n+1),","))
-
Sage
def A122038_list(prec): P.
= PowerSeriesRing(ZZ, prec) return P( 36*x*(1-15*x)/((1-3*x)*(1-9*x)*(1-27*x)) ).list() a=A122038_list(20); a[1:] # G. C. Greubel, Oct 04 2019
Formula
a(n) = 3^(3*n) + 2*3^(2*n) - 3^(n+1) = (3^(n-1) + 1)*(3^n-1)*3^(n+1).
From G. C. Greubel, Oct 04 2019: (Start)
G.f.: 36*x*(1-15*x)/((1-3*x)*(1-9*x)*(1-27*x)).
E.g.f.: exp(27*x) + 2*exp(9*x) - 3*exp(3*x). (End)