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.

Showing 1-5 of 5 results.

A004197 Triangle read by rows. T(n, k) = n - k if n - k < k, otherwise k.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 2, 1, 0, 0, 1, 2, 2, 1, 0, 0, 1, 2, 3, 2, 1, 0, 0, 1, 2, 3, 3, 2, 1, 0, 0, 1, 2, 3, 4, 3, 2, 1, 0, 0, 1, 2, 3, 4, 4, 3, 2, 1, 0, 0, 1, 2, 3, 4, 5, 4, 3, 2, 1, 0, 0, 1, 2, 3, 4, 5, 5, 4, 3, 2, 1, 0, 0, 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1, 0, 0, 1, 2, 3, 4, 5, 6, 6, 5, 4, 3, 2, 1, 0, 0, 1, 2
Offset: 0

Views

Author

Keywords

Comments

Table of min(x,y), where (x,y) = (0,0),(0,1),(1,0),(0,2),(1,1),(2,0),...
Highest power of 6 that divides A036561. - Fred Daniel Kline, May 29 2012
Triangle T(n,k) read by rows: T(n,k) = min(k,n-k). - Philippe Deléham, Feb 25 2014

Examples

			From _Philippe Deléham_, Feb 25 2014: (Start)
Top left corner of table:
  0 0 0 0
  0 1 1 1
  0 1 2 2
  0 1 2 3
Triangle T(n,k) begins:
  0;
  0, 0;
  0, 1, 0;
  0, 1, 1, 0;
  0, 1, 2, 1, 0;
  0, 1, 2, 2, 1, 0;
  0, 1, 2, 3, 2, 1, 0;
  0, 1, 2, 3, 3, 2, 1, 0;
  0, 1, 2, 3, 4, 3, 2, 1, 0;
  0, 1, 2, 3, 4, 4, 3, 2, 1, 0;
  0, 1, 2, 3, 4, 5, 4, 3, 2, 1, 0;
  0, 1, 2, 3, 4, 5, 5, 4, 3, 2, 1, 0;
  0, 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1, 0;
  0, 1, 2, 3, 4, 5, 6, 6, 5, 4, 3, 2, 1, 0;
  0, 1, 2, 3, 4, 5, 6, 7, 6, 5, 4, 3, 2, 1, 0;
  0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0;
  ... (End)
		

Crossrefs

Similar to but strictly different from A087062 and A261684.
Row sums give A002620. - Reinhard Zumkeller, Jul 27 2005
Positions of zero are given in A117142. - Ridouane Oudra, Apr 30 2019

Programs

  • Haskell
    a004197 n k = a004197_tabl !! n !! k
    a004197_tabl = map a004197_row [0..]
    a004197_row n = hs ++ drop (1 - n `mod` 2) (reverse hs)
       where hs = [0..n `div` 2]
    -- Reinhard Zumkeller, Aug 14 2011
    
  • Maple
    T := (n, k) -> if n - k < k then n - k else k fi:
    for n from 0 to 9 do seq(T(n, k), k=0..n) od; # Peter Luschny, May 07 2023
  • Mathematica
    Flatten[Table[IntegerExponent[2^(n - k) 3^k, 6], {n, 0, 20}, {k, 0, n}]] (* Fred Daniel Kline, May 29 2012 *)
  • PARI
    T(x,y)=min(x,y) \\ Charles R Greathouse IV, Feb 07 2017

Formula

a(n) = A003983(n) - 1.
G.f.: x*y/((1-x)*(1-y)*(1-x*y)). - Franklin T. Adams-Watters, Feb 06 2006
2^T(n,k) = A144464(n,k), 3^T(n,k) = A152714(n,k), 4^T(n,k) = A152716(n,k), 5^T(n,k) = A152717(n,k). - Philippe Deléham, Feb 25 2014
a(n) = (1/2)*(t - 1 - abs(t^2 - 2*n - 1)), where t = floor(sqrt(2*n+1)+1/2). - Ridouane Oudra, May 03 2019

Extensions

Mathematica program fixed by Harvey P. Dale, Nov 26 2020
Name edited by Peter Luschny, May 07 2023

A144464 Triangle T(n,m) read by rows: T(n,m) = 2^min(m,n-m).

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 2, 4, 2, 1, 1, 2, 4, 4, 2, 1, 1, 2, 4, 8, 4, 2, 1, 1, 2, 4, 8, 8, 4, 2, 1, 1, 2, 4, 8, 16, 8, 4, 2, 1, 1, 2, 4, 8, 16, 16, 8, 4, 2, 1, 1, 2, 4, 8, 16, 32, 16, 8, 4, 2, 1
Offset: 0

Views

Author

Roger L. Bagula and Gary W. Adamson, Oct 09 2008

Keywords

Examples

			The triangle starts in row n=0 as:
{1},
{1, 1},
{1, 2, 1},
{1, 2, 2, 1},
{1, 2, 4, 2, 1},
{1, 2, 4, 4, 2, 1},
{1, 2, 4, 8, 4, 2, 1},
{1, 2, 4, 8, 8, 4, 2, 1},
{1, 2, 4, 8, 16, 8, 4, 2, 1},
{1, 2, 4, 8, 16, 16, 8, 4, 2, 1},
{1, 2, 4, 8, 16, 32, 16, 8, 4, 2, 1}
		

Crossrefs

Programs

  • Mathematica
    Clear[f, t]; f[n_, m_] = If[m <= Floor[n/2], m, n - m]; Table[Table[f[n, m], {m, 0, n}], {n, 0, 10}]; Flatten[%]
  • PARI
    T(n,m)=1<Charles R Greathouse IV, Jan 15 2012

Formula

Row sums: sum_{m=0..n} T(n,m) = A027383(n).
T(n,k) = 2^A004197(n,k). - Philippe Deléham, Feb 25 2014

Extensions

Offset corrected by the Associate Editors of the OEIS, Sep 11 2009
Better name by Philippe Deléham, Feb 25 2014

A152716 Triangle T(n,k) read by rows: T(n,k) = 4^min(k, n-k) = 4^A004197(n,k).

Original entry on oeis.org

1, 1, 1, 1, 4, 1, 1, 4, 4, 1, 1, 4, 16, 4, 1, 1, 4, 16, 16, 4, 1, 1, 4, 16, 64, 16, 4, 1, 1, 4, 16, 64, 64, 16, 4, 1, 1, 4, 16, 64, 256, 64, 16, 4, 1, 1, 4, 16, 64, 256, 256, 64, 16, 4, 1, 1, 4, 16, 64, 256, 1024, 256, 64, 16, 4, 1
Offset: 0

Views

Author

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

Keywords

Comments

Row sums are: {1, 2, 6, 10, 26, 42, 106, 170, 426, 682, 1706,...} = A061547(n+2).

Examples

			{1},
{1, 1},
{1, 4, 1},
{1, 4, 4, 1},
{1, 4, 16, 4, 1},
{1, 4, 16, 16, 4, 1},
{1, 4, 16, 64, 16, 4, 1},
{1, 4, 16, 64, 64, 16, 4, 1},
{1, 4, 16, 64, 256, 64, 16, 4, 1},
{1, 4, 16, 64, 256, 256, 64, 16, 4, 1},
{1, 4, 16, 64, 256, 1024, 256, 64, 16, 4, 1}
		

Crossrefs

Programs

  • Mathematica
    Clear[a, k, m]; k = 4; 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[%]

Formula

T(n,k) = 4^min(k, n-k). - Philippe Deléham, Feb 25 2014
T(n,k) = A144464(n,k)^2. - Philippe Deléham, Feb 26 2014

Extensions

Better name by Philippe Deléham, Feb 25 2014

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

A238366 a(n) = 5*a(n-2) + 2, a(0) = 1, a(1) = 2.

Original entry on oeis.org

1, 2, 7, 12, 37, 62, 187, 312, 937, 1562, 4687, 7812, 23437, 39062, 117187, 195312, 585937, 976562, 2929687, 4882812, 14648437, 24414062, 73242187, 122070312, 366210937, 610351562, 1831054687, 3051757812, 9155273437, 15258789062, 45776367187, 76293945312
Offset: 0

Views

Author

Philippe Deléham, Feb 25 2014

Keywords

Comments

Row sums of triangle in A152717.

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{1,5,-5},{1,2,7},40] (* Harvey P. Dale, Jul 18 2024 *)

Formula

G.f.: (1+x)/((1-x)*(1-5*x^2)).
a(n) = Sum_{k=0..n} A152717(n,k).
a(2*n) = A057651(n).
a(2*n+1) = A125831(n+1) = 2*A003463(n+1).
a(n) = a(n-1) + 5*a(n-2) - 5*a(n-3), a(0) = 1, a(1) = 2, a(2) = 7.
a(n) = A198306(n+1) for n > 1. - Georg Fischer, Oct 23 2018
Showing 1-5 of 5 results.