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.

A176177 a(n) = 2*n*3^(n-1) - (3^n-1)/2.

Original entry on oeis.org

0, 1, 8, 41, 176, 689, 2552, 9113, 31712, 108257, 364136, 1210505, 3985808, 13020305, 42249560, 136314617, 437641664, 1399018433, 4455335624, 14140847849, 44747066480, 141214768241, 444565011128, 1396457152601, 4377657815456, 13697832519329, 42788074776872, 133447955987273, 415595062931792, 1292538773705297, 4014877075845656
Offset: 0

Views

Author

N. J. A. Sloane, Dec 18 2010

Keywords

Programs

  • Magma
    I:=[0,1,8]; [n le 3 select I[n] else 7*Self(n-1)-15*Self(n-2)+9*Self(n-3): n in [1..40]]; // Vincenzo Librandi, Jun 17 2014
    
  • Mathematica
    Table[2n 3^(n-1)-(3^n-1)/2,{n,0,40}] (* or *) LinearRecurrence[{7,-15,9},{0,1,8},40] (* Harvey P. Dale, Jun 16 2014 *)
    CoefficientList[Series[-x (1 + x)/((x - 1) (-1 + 3 x)^2), {x, 0, 30}], x] (* Vincenzo Librandi, Jun 17 2014 *)
  • PARI
    first(m)=vector(m,n,2*n*3^(n-1)-(3^n-1)/2); /* Anders Hellström, Aug 10 2015 */

Formula

G.f.: -x*(1+x) / ( (x-1)*(-1+3*x)^2 ). - R. J. Mathar, Sep 04 2013
a(n) = 7*a(n-1) - 15*a(n-2) + 9*a(n-3) for n>2. - Vincenzo Librandi, Jun 17 2014
The companion matrix of the polynomial x^3 - 7*x^2 + 15*x - 9 is [(1,0,0); (1,3,0); (1,4,3)] = M, then M^n * [1,1,1] generates the sequence, extracting the lower term. - Gary W. Adamson, Aug 10 2015