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.

A254006 a(0) = 1, a(n) = 3*a(n-2) if n mod 2 = 0, otherwise a(n) = 0.

Original entry on oeis.org

1, 0, 3, 0, 9, 0, 27, 0, 81, 0, 243, 0, 729, 0, 2187, 0, 6561, 0, 19683, 0, 59049, 0, 177147, 0, 531441, 0, 1594323, 0, 4782969, 0, 14348907, 0, 43046721, 0, 129140163, 0, 387420489, 0, 1162261467, 0, 3486784401, 0, 10460353203, 0, 31381059609, 0, 94143178827
Offset: 0

Views

Author

Kival Ngaokrajang, Jan 26 2015

Keywords

Comments

Inspired by the Lévy C-curve, and generated using different construction rules as shown in the links.
The length of this variant Lévy C-curve is an integer in the real quadratic number field Q(sqrt(3)), namely L(n) = A(n) + B(n)*sqrt(3) with A(n) = a(n) and B(n) = a(n-1), with a(0) = 1. See the construction rule and the illustration in the links.
Powers of 3 interspersed with zeros. - Colin Barker, Jan 26 2015

Crossrefs

Programs

  • Mathematica
    nxt[{n_,a_,b_}]:={n+1,b,If[OddQ[n],3a,0]}; Transpose[NestList[nxt,{1,1,0},50]][[2]] (* or *) With[{nn=25},Riffle[3^Range[0,nn],0]] (* Harvey P. Dale, Nov 30 2015 *)
  • PARI
    {
    a=1; print1(a,", ");
    for (n=1,100,
         if (Mod(n,2)==0,
             a=a*3;
             print1(a,", "),
             print1(0,", ")
         )
    )
    }
    
  • PARI
    Vec(-1/(3*x^2-1) + O(x^100)) \\ Colin Barker, Jan 26 2015
    
  • PARI
    a(n) = if(n%2==0,3^(n/2),0) \\ Jason Yuen, Mar 24 2025

Formula

a(n) = 3*a(n-2) if n mod 2 = 0, otherwise a(n) = 0, a(0) = 1.
a(n) = (3^(n/2)*(1+(-1)^n))/2. - Colin Barker, Jan 26 2015
G.f.: -1 / (3*x^2-1). - Colin Barker, Jan 26 2015