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.

A152714 Triangle read by rows: T(n,k) = 3^min(k, n-k).

Original entry on oeis.org

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

Views

Author

Roger L. Bagula and Gary W. Adamson, Dec 11 2008

Keywords

Examples

			Triangle begins
  {1},
  {1, 1},
  {1, 3, 1},
  {1, 3, 3,  1},
  {1, 3, 9,  3,  1},
  {1, 3, 9,  9,  3,   1},
  {1, 3, 9, 27,  9,   3,  1},
  {1, 3, 9, 27, 27,   9,  3,  1},
  {1, 3, 9, 27, 81,  27,  9,  3, 1},
  {1, 3, 9, 27, 81,  81, 27,  9, 3, 1},
  {1, 3, 9, 27, 81, 243, 81, 27, 9, 3, 1}
		

Crossrefs

Cf. A004197, A144464, A152716, A152717, A062318 (row sums).

Programs

  • Magma
    [[3^(Min(k,n-k)): k in [0..n]]: n in [0..15]]; // G. C. Greubel, Sep 01 2018
  • Mathematica
    Clear[a, k, m]; k = 3; a[0] = {1}; a[1] = {1, 1};
    a[n_] := a[n] = Join[{1}, k*a[n - 2], {1}];
    Table[a[n], {n, 0, 10}];
    Flatten[%]
    Table[3^(Min[k, n - k]), {n, 0, 100}, {k, 0, n}] // Flatten (* G. C. Greubel, Sep 01 2018 *)
  • PARI
    for(n=0,15, for(k=0,n, print1(3^(min(k,n-k)), ", "))) \\ G. C. Greubel, Sep 01 2018
    

Formula

T(n,k) = 3^min(k, n-k) = 3^A004197(n,k). - Philippe Deléham, Feb 25 2014

Extensions

Better name by Philippe Deléham, Feb 25 2014