login
A371727
Number of Dyck paths of semilength n such that neighboring peaks differ in height by exactly one and first and last peak are at height one.
3
1, 1, 0, 0, 1, 0, 0, 2, 2, 1, 5, 12, 16, 28, 65, 128, 237, 478, 990, 2006, 4086, 8469, 17644, 36826, 77305, 163195, 345798, 735302, 1569379, 3360821, 7218566, 15548176, 33578893, 72698472, 157755230, 343071238, 747603060, 1632264655, 3570221869, 7822430724
OFFSET
0,8
EXAMPLE
a(4) = 1: /\
/\/ \/\
. /\
a(7) = 2: /\ /\ /\/ \/\
/\/ \/\/ \/\ /\/ \/\ .
MAPLE
b:= proc(x, y, h, t) option remember; `if`(y<0 or y>x, 0,
`if`(x=0, `if`(h>1, 0, 1), `if`(t=1 and abs(y-h)<>1, 0,
b(x-1, y-1, `if`(t=1, y, h), 0))+b(x-1, y+1, h, 1)))
end:
a:= n-> b(2*n, 0$3):
seq(a(n), n=0..50);
# second Maple program:
b:= proc(x, y) option remember; (t->
`if`(x=t, 1, `if`(x<t, 0, b(x-1-2*y, y+1)+add(add(
b(x-1-2*i, y+j), j=[-1, 1]), i=1..y-1))))(3*y-2)
end:
a:= n-> `if`(n=0, 1, b(2*n-1, 1)):
seq(a(n), n=0..50);
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Apr 05 2024
STATUS
approved