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.

A132171 3^n repeated 3^n times.

Original entry on oeis.org

1, 3, 3, 3, 9, 9, 9, 9, 9, 9, 9, 9, 9, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81
Offset: 0

Views

Author

Paul Curtz, Nov 04 2007

Keywords

Crossrefs

Programs

  • Haskell
    import Data.List (transpose)
    a132171 n = genericIndex a132171_list n
    a132171_list = 1 : zs where
       zs = 3 : 3 : 3 : (map (* 3) $ concat $ transpose [zs, zs, zs])
    -- Reinhard Zumkeller, Sep 01 2015
    
  • Maple
    seq((3^n)$(3^n),n=0..5); # Robert Israel, Feb 24 2017
  • Mathematica
    Table[ConstantArray[3^n, 3^n], {n, 0, 4}] // Flatten (* or *)
    Table[3^Floor@ Log[3, 2 n + 1], {n, 0, 81}] (* Michael De Vlieger, Feb 24 2017 *)
  • Python
    from sympy import integer_log
    def A132171(n): return 3**integer_log((n<<1)+1,3)[0] # Chai Wah Wu, Nov 04 2024

Formula

From Robert Israel, Feb 24 2017: (Start)
a(n) = 3^floor(log_3(2n+1)).
a(3*n+1) = a(3*n+2) = a(3*n+3) = 3*a(n).
G.f.: (1-x)^(-1)*Sum_{m>=1} (3^m-3^(m-1))*x^((3^m-1)/2).
(End)
Sum_{n>=0} 1/a(n)^2 = 3/2. - Amiram Eldar, Aug 16 2022