A266386 Sum over all Motzkin paths of length n of products over all peaks p of (x_p+n*y_p)/y_p, where x_p and y_p are the coordinates of peak p.
1, 1, 4, 11, 62, 243, 1575, 7721, 54985, 316407, 2427309, 15798261, 129072167, 927577835, 8008756470, 62499194297, 567017727805, 4747097031375, 45051331382395, 400942371431173, 3965769826314532, 37252002703698003, 382848953452815450, 3774255187367667473
Offset: 0
Keywords
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..500
- Wikipedia, Motzkin number
Crossrefs
Main diagonal of A258306.
Programs
-
Maple
b:= proc(x, y, t, k) option remember; `if`(y>x or y<0, 0, `if`(x=0, 1, b(x-1, y-1, false, k)*`if`(t, (x+k*y)/y, 1) +b(x-1, y, false, k) +b(x-1, y+1, true, k))) end: a:= n-> b(n, 0, false, n): seq(a(n), n=0..30);
-
Mathematica
b[x_, y_, t_, k_] := b[x, y, t, k] = If[y > x || y < 0, 0, If[x == 0, 1, b[x - 1, y - 1, False, k]*If[t, (x + k*y)/y, 1] + b[x - 1, y, False, k] + b[x - 1, y + 1, True, k]]]; a[n_] := b[n, 0, False, n]; Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Jun 10 2017, translated from Maple *)
Formula
a(n) = A258306(n,n).