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.

A337277 Stern's triangle read by rows.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 2, 1, 3, 2, 3, 1, 3, 2, 3, 1, 2, 1, 1, 1, 1, 2, 1, 3, 2, 3, 1, 4, 3, 5, 2, 5, 3, 4, 1, 4, 3, 5, 2, 5, 3, 4, 1, 3, 2, 3, 1, 2, 1, 1, 1, 1, 2, 1, 3, 2, 3, 1, 4, 3, 5, 2, 5, 3, 4, 1, 5, 4, 7, 3, 8, 5, 7, 2, 7, 5, 8, 3, 7, 4, 5, 1, 5, 4, 7, 3, 8, 5, 7, 2, 7, 5, 8, 3, 7, 4, 5, 1, 4, 3, 5, 2, 5, 3, 4, 1, 3, 2, 3, 1, 2, 1, 1
Offset: 0

Views

Author

N. J. A. Sloane, Sep 09 2020

Keywords

Comments

The first two rows are 1, then 1,1,1. To get row n, copy row n-1, and insert c+d between every pair of adjacent terms c,d, and finally insert a 1 at the beginning and end of the row.
The maximum value in row n is A000045(n+1). - Alois P. Heinz, Sep 09 2020

Examples

			Triangle begins:
  1;
  1, 1, 1;
  1, 1, 2, 1, 2, 1, 1;
  1, 1, 2, 1, 3, 2, 3, 1, 3, 2, 3, 1, 2, 1, 1;
  1, 1, 2, 1, 3, 2, 3, 1, 4, 3, 5, 2, 5, 3, 4, 1, 4, 3, 5, 2, 5, 3, 4, 1, 3, 2, 3, 1, 2, 1, 1;
  ...
		

References

  • Stanley, Richard P. "Some Linear Recurrences Motivated by Stern’s Diatomic Array." The American Mathematical Monthly 127.2 (2020): 99-111.

Crossrefs

Row sums give A000244.
Row lengths give A126646.

Programs

  • Maple
    T:= proc(n) option remember; `if`(n=0, 1, (L-> [1, L[1], seq(
          [L[i-1]+L[i], L[i]][], i=2..nops(L)), 1][])([T(n-1)]))
        end:
    seq(T(n), n=0..6);  # Alois P. Heinz, Sep 09 2020
  • Mathematica
    Nest[Append[#, Flatten@ Join[{1}, If[Length@ # > 1, Map[{#1, #1 + #2} & @@ # &, Partition[#[[-1]], 2, 1] ], {}], {#[[-1, -1]]}, {1}]] &, {{1}}, 5] // Flatten (* Michael De Vlieger, Sep 09 2020 *)

Formula

T(n,n) = A002487(n+1). - Alois P. Heinz, Sep 09 2020