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.

A283595 Triangle read by rows: T(n,k) is the number of Motzkin prefixes (i.e., left factors of Motzkin paths) of length n and height k.

This page as a plain text file.
%I A283595 #41 Mar 26 2018 13:02:34
%S A283595 1,1,1,1,3,1,1,7,4,1,1,15,13,5,1,1,31,38,19,6,1,1,63,105,64,26,7,1,1,
%T A283595 127,280,202,97,34,8,1,1,255,729,612,334,139,43,9,1,1,511,1866,1803,
%U A283595 1094,516,191,53,10,1,1,1023,4717,5205,3465,1802,760,254,64,11,1
%N A283595 Triangle read by rows: T(n,k) is the number of Motzkin prefixes (i.e., left factors of Motzkin paths) of length n and height k.
%C A283595 Row n has n+1 entries.
%H A283595 Alois P. Heinz, <a href="/A283595/b283595.txt">Rows n = 0..140, flattened</a>
%H A283595 Steven R. Finch, <a href="https://arxiv.org/abs/1802.04615">How far might we walk at random?</a>, arXiv:1802.04615 [math.HO], 2018.
%e A283595 Triangle starts:
%e A283595   1;
%e A283595   1,  1;
%e A283595   1,  3,  1;
%e A283595   1,  7,  4,  1;
%e A283595   1, 15, 13,  5,  1;
%e A283595   1, 31, 38, 19,  6,  1;
%e A283595   ...
%e A283595 T(3,2) = 4 because we have UHU, HUU, UUD and UUH, where U=(1,1), D=(1,-1), H=(1,0).
%e A283595 T(3,1) = 7 because we have UDH, HUD, UHD, UHH, HUH, HHU and UDU.
%p A283595 b:= proc(x, y, m) option remember; `if`(x=0, z^m, b(x-1, y, m)+
%p A283595       `if`(y>0, b(x-1, y-1, m), 0)+b(x-1, y+1, max(m, y+1)))
%p A283595     end:
%p A283595 T:= n-> (p-> seq(coeff(p, z, i), i=0..n))(b(n, 0$2)):
%p A283595 seq(T(n), n=0..12);  # _Alois P. Heinz_, Mar 13 2017
%t A283595 b[x_, y_, m_] := b[x, y, m] = If[x==0, z^m, b[x-1, y, m] + If[y>0, b[x-1, y - 1, m], 0] + b[x-1, y+1, Max[m, y+1]]]; T[n_] := Function[p, Table[ Coefficient[p, z, i], {i, 0, n}]][b[n, 0, 0]]; Table[T[n], {n, 0, 12}] // Flatten (* _Jean-François Alcover_, Mar 18 2017, after _Alois P. Heinz_ *)
%Y A283595 Row sums give A005773(n+1).
%Y A283595 T(2n,n) gives A283667.
%Y A283595 Cf. A000225, A097862, A282869.
%K A283595 nonn,tabl
%O A283595 0,5
%A A283595 _Steven Finch_, Mar 13 2017
%E A283595 More terms from _Alois P. Heinz_, Mar 13 2017