login
Triangle read by rows. Same rule as Aitken triangle (A011971) except T(0,0) = 1, T(1,0) = 2.
5

%I #20 Mar 27 2022 10:54:23

%S 1,2,3,3,5,8,8,11,16,24,24,32,43,59,83,83,107,139,182,241,324,324,407,

%T 514,653,835,1076,1400,1400,1724,2131,2645,3298,4133,5209,6609,6609,

%U 8009,9733,11864,14509,17807,21940,27149,33758

%N Triangle read by rows. Same rule as Aitken triangle (A011971) except T(0,0) = 1, T(1,0) = 2.

%H Reinhard Zumkeller, <a href="/A046937/b046937.txt">Rows n = 0..120 of triangle, flattened</a>

%e Triangle starts:

%e [0] [ 1]

%e [1] [ 2, 3]

%e [2] [ 3, 5, 8]

%e [3] [ 8, 11, 16, 24]

%e [4] [ 24, 32, 43, 59, 83]

%e [5] [ 83, 107, 139, 182, 241, 324]

%e [6] [ 324, 407, 514, 653, 835, 1076, 1400]

%e [7] [1400, 1724, 2131, 2645, 3298, 4133, 5209, 6609]

%e [8] [6609, 8009, 9733, 11864, 14509, 17807, 21940, 27149, 33758]

%p # Compare the analogue algorithm for the Catalan triangle in A350584.

%p A046937Triangle := proc(len) local A, P, T, n; A := [2]; P := [1]; T := [[1]];

%p for n from 1 to len-1 do P := ListTools:-PartialSums([A[-1], op(P)]);

%p A := P; T := [op(T), P] od; T end:

%p A046937Triangle(9): ListTools:-Flatten(%); # _Peter Luschny_, Mar 27 2022

%t a[0, 0] = 1; a[1, 0] = 2; a[n_, 0] := a[n-1, n-1]; a[n_, k_] := a[n, k] = a[n, k-1] + a[n-1, k-1]; Table[a[n, k], {n, 0, 9}, {k, 0, n}] // Flatten (* _Jean-François Alcover_, Jun 06 2013 *)

%o (Haskell)

%o a046937 n k = a046937_tabl !! n !! k

%o a046937_row n = a046937_tabl !! n

%o a046937_tabl = [1] : iterate (\row -> scanl (+) (last row) row) [2,3]

%o -- _Reinhard Zumkeller_, Jan 13 2013

%Y Borders give A038561.

%Y Cf. A011971.

%K tabl,easy,nice,nonn

%O 0,2

%A _N. J. A. Sloane_, _R. K. Guy_