OFFSET
0,3
COMMENTS
For n = 2, there is no 3rd up step, a(2) = 9 enumerates the total number of down steps between the 2nd up step and the end of the path.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1212
A. Asinowski, B. Hackl, and S. Selkirk, Down step statistics in generalized Dyck paths, arXiv:2007.15562 [math.CO], 2020.
FORMULA
a(0) = a(1) = 0 and a(n) = 2*Sum_{j=1..2} binomial(3*j+1,j) * binomial(3*(n-j),n-j) / ((3*j+1)*(n-j+1)) for n > 1.
EXAMPLE
For n = 2, there are the 2-Dyck paths UUDDDD, UDUDDD, UDDUDD. Between the 2nd up step and the end of the path there are a(2) = 4 + 3 + 2 = 9 down steps in total.
MAPLE
b:= proc(x, y, u, c) option remember; `if`(x=0, c,
`if`(y+2<x, b(x-1, y+2, min(u+1, 3), c), 0)+
`if`(y>0, b(x-1, y-1, u, c+`if`(u=2, 1, 0)), 0))
end:
a:= n-> b(3*n, 0$3):
seq(a(n), n=0..24); # Alois P. Heinz, May 09 2020
# second Maple program:
a:= proc(n) option remember; `if`(n<3, [0$2, 9][n+1],
(3*(n-1)*(3*n-8)*(3*n-7)*(13*n-20)*a(n-1))/
(2*(13*n-33)*(n-2)*(2*n-3)*n))
end:
seq(a(n), n=0..24); # Alois P. Heinz, May 09 2020
MATHEMATICA
a[0] = a[1] = 0; a[n_] := 2 * Sum[Binomial[3*j + 1, j] * Binomial[3*(n - j), n - j]/((3*j + 1)*(n - j + 1)), {j, 1, 2}]; Array[a, 25, 0] (* Amiram Eldar, May 09 2020 *)
PROG
(PARI) a(n) = if (n<=1, 0, 2*sum(j=1, 2, binomial(3*j+1, j) * binomial(3*(n-j), n-j)/((3*j+1)*(n-j+1)))); \\ Michel Marcus, May 09 2020
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Benjamin Hackl, May 07 2020
STATUS
approved