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.

A333608 Sum of the heights of all nonnegative lattice paths from (0,0) to (n,0) where the allowed steps at (x,y) are (1,v) with v in {-1,0,...,max(y,1)}.

This page as a plain text file.
%I A333608 #16 May 12 2020 08:41:06
%S A333608 0,0,1,3,9,25,70,200,584,1742,5304,16471,52120,167885,549856,1828897,
%T A333608 6170108,21087458,72923515,254880303,899454849,3201729220,11486266036,
%U A333608 41497996004,150879471934,551723923040,2027990653855,7489507917594,27777837416779,103427750936183
%N A333608 Sum of the heights of all nonnegative lattice paths from (0,0) to (n,0) where the allowed steps at (x,y) are (1,v) with v in {-1,0,...,max(y,1)}.
%C A333608 The maximal height in all paths of length n is A103354(n-1).
%H A333608 Alois P. Heinz, <a href="/A333608/b333608.txt">Table of n, a(n) for n = 0..500</a>
%H A333608 Wikipedia, <a href="https://en.wikipedia.org/wiki/Lattice_path#Counting_lattice_paths">Counting lattice paths</a>
%H A333608 Wikipedia, <a href="https://en.wikipedia.org/wiki/Motzkin_number">Motzkin number</a>
%p A333608 b:= proc(x, y, h) option remember;
%p A333608      `if`(x=0, h, add(b(x-1, y+j, max(y, h)),
%p A333608       j=-min(1, y)..min(max(1, y), x-y-1)))
%p A333608     end:
%p A333608 a:= n-> b(n, 0$2):
%p A333608 seq(a(n), n=0..29);
%t A333608 b[x_, y_, h_] := b[x, y, h] = If[x == 0, h, Sum[b[x - 1, y + j, Max[y, h]], {j, -Min[1, y], Min[Max[1, y], x - y - 1]}]];
%t A333608 a[n_] := b[n, 0, 0];
%t A333608 a /@ Range[0, 29] (* _Jean-François Alcover_, May 12 2020, after Maple *)
%Y A333608 Cf. A103354, A333105, A333106, A333107, A333498, A333504.
%K A333608 nonn
%O A333608 0,4
%A A333608 _Alois P. Heinz_, Mar 28 2020