A333105 Number of 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)}.
1, 1, 2, 4, 9, 21, 51, 128, 331, 880, 2402, 6724, 19285, 56612, 169908, 520723, 1627477, 5180064, 16766824, 55112302, 183710312, 620213500, 2118094664, 7309077920, 25459737905, 89438446602, 316606738516, 1128566016617, 4048230694964, 14604517154115
Offset: 0
Keywords
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..1673
- Wikipedia, Counting lattice paths
- Wikipedia, Motzkin number
Programs
-
Maple
b:= proc(x, y) option remember; `if`(x=0, 1, add( b(x-1, y+j), j=-min(1, y)..min(max(1, y), x-y-1))) end: a:= n-> b(n, 0): seq(a(n), n=0..29);
-
Mathematica
b[x_, y_] := b[x, y] = If[x == 0, 1, Sum[b[x - 1, y + j], {j, -Min[1, y], Min[Max[1, y], x - y - 1]}]]; a[n_] := b[n, 0]; a /@ Range[0, 29] (* Jean-François Alcover, Mar 30 2021, after Alois P. Heinz *)
Formula
a(n) >= A001006(n) with equality only for n <= 6.
a(n) ~ c * 4^n / n^(3/2), where c = 0.0019335749177095597674777855613451543338378695415042866523284... - Vaclav Kotesovec, Oct 24 2021
Comments