login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A337277 Stern's triangle read by rows. 5

%I #31 Nov 19 2020 19:33:54

%S 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,

%T 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,

%U 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

%N Stern's triangle read by rows.

%C 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.

%C The maximum value in row n is A000045(n+1). - _Alois P. Heinz_, Sep 09 2020

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

%H Alois P. Heinz, <a href="/A337277/b337277.txt">Rows n = 0..14, flattened</a>

%H Richard P. Stanley, <a href="https://arxiv.org/abs/1901.04647">Some Linear Recurrences Motivated by Stern's Diatomic Array</a>, arXiv:1901.04647 [math.CO], 2019.

%F T(n,n) = A002487(n+1). - _Alois P. Heinz_, Sep 09 2020

%e Triangle begins:

%e 1;

%e 1, 1, 1;

%e 1, 1, 2, 1, 2, 1, 1;

%e 1, 1, 2, 1, 3, 2, 3, 1, 3, 2, 3, 1, 2, 1, 1;

%e 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;

%e ...

%p T:= proc(n) option remember; `if`(n=0, 1, (L-> [1, L[1], seq(

%p [L[i-1]+L[i], L[i]][], i=2..nops(L)), 1][])([T(n-1)]))

%p end:

%p seq(T(n), n=0..6); # _Alois P. Heinz_, Sep 09 2020

%t 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 *)

%Y Cf. A000045, A002487, A049456, A334627.

%Y Row sums give A000244.

%Y Row lengths give A126646.

%K nonn,tabf

%O 0,7

%A _N. J. A. Sloane_, Sep 09 2020

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 15:34 EDT 2024. Contains 371794 sequences. (Running on oeis4.)