A337277 Stern's triangle read by rows.
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
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.
Links
- Alois P. Heinz, Rows n = 0..14, flattened
- Richard P. Stanley, Some Linear Recurrences Motivated by Stern's Diatomic Array, arXiv:1901.04647 [math.CO], 2019.
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
Comments