cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-1 of 1 results.

A122038 a(n) = 1*3^(3*n) + 2*3^(2*n) - 3*3^(1*n).

Original entry on oeis.org

36, 864, 21060, 544320, 14466276, 388481184, 10469912580, 282515610240, 7626372266916, 205898105486304, 5559123328143300, 150095200154477760, 4052560236745849956, 109419034885082920224, 2954313118333054841220
Offset: 1

Views

Author

Herman Jamke (hermanjamke(AT)fastmail.fm), Sep 14 2006

Keywords

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)
Showing 1-1 of 1 results.