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.

A193410 Expansion of (1-3*x)/(1-6*x+18*x^2).

Original entry on oeis.org

1, 3, 0, -54, -324, -972, 0, 17496, 104976, 314928, 0, -5668704, -34012224, -102036672, 0, 1836660096, 11019960576, 33059881728, 0, -595077871104, -3570467226624, -10711401679872, 0, 192805230237696, 1156831381426176, 3470494144278528
Offset: 0

Views

Author

Bruno Berselli, Aug 04 2011

Keywords

Comments

Also real parts of 3^n*(1+i)^n, where i=sqrt(-1).
If |a(n)| > 0 then it is in A130505.

Crossrefs

Programs

  • Magma
    m:=26; R:=PowerSeriesRing(Integers(), m); Coefficients(R!((1-3*x)/(1-6*x+18*x^2))); /* or */ &cat[[r,3*r,0,-54*r] where r is (-324)^n: n in [0..6]];
    
  • Magma
    I:=[1, 3]; [n le 2 select I[n] else 6*Self(n-1)-18*Self(n-2): n in [1..30]]; // Vincenzo Librandi, Mar 26 2013
  • Mathematica
    CoefficientList[Series[(1 - 3 x)/(1 - 6 x + 18 x^2), {x, 0, 30}], x] (* Vincenzo Librandi, Mar 26 2013 *)
    LinearRecurrence[{6,-18},{1,3},40] (* Harvey P. Dale, Jul 27 2021 *)
  • Maxima
    makelist(coeff(taylor((1-3*x)/(1-6*x+18*x^2), x, 0, n), x, n), n, 0, 25);
    
  • PARI
    Vec((1-3*x)/(1-6*x+18*x^2) +O(x^26))
    

Formula

G.f.: (1-3*x)/(1-6*x+18*x^2).
a(n) = 3^n*A146559(n) = (1/2)*((3+3*i)^n+(3-3*i)^n), where i=sqrt(-1).
a(n) = 6*a(n-1)-18*a(n-2) for n>1.
a(n) = (3*sqrt(2))^n*cos(pi*n/4).
a(4k+2) = 0, a(4k+1) = 3*a(4k) = 18*a(4k-1) = 3*(-324)^k.
G.f.: W(0)/2, where W(k) = 1 + 1/(1 - x*(3*k+3)/(x*(3*k+6) + 1/W(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Aug 28 2013