login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

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.
2

%I #11 Jun 10 2017 14:08:13

%S 1,1,4,11,62,243,1575,7721,54985,316407,2427309,15798261,129072167,

%T 927577835,8008756470,62499194297,567017727805,4747097031375,

%U 45051331382395,400942371431173,3965769826314532,37252002703698003,382848953452815450,3774255187367667473

%N 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.

%H Alois P. Heinz, <a href="/A266386/b266386.txt">Table of n, a(n) for n = 0..500</a>

%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Motzkin_number">Motzkin number</a>

%F a(n) = A258306(n,n).

%p b:= proc(x, y, t, k) option remember; `if`(y>x or y<0, 0,

%p `if`(x=0, 1, b(x-1, y-1, false, k)*`if`(t, (x+k*y)/y, 1)

%p +b(x-1, y, false, k) +b(x-1, y+1, true, k)))

%p end:

%p a:= n-> b(n, 0, false, n):

%p seq(a(n), n=0..30);

%t 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]]];

%t a[n_] := b[n, 0, False, n];

%t Table[a[n], {n, 0, 30}] (* _Jean-François Alcover_, Jun 10 2017, translated from Maple *)

%Y Main diagonal of A258306.

%K nonn

%O 0,3

%A _Alois P. Heinz_, Dec 28 2015