OFFSET
0,2
COMMENTS
This is the quantity S_{n-1} as given by a literal reading of Dershowitz and Rinderknecht (2015), Equations (1) and (2). If the lower limit in the right-hand sum in Eq. (1) is changed to "h >= 2", we obtain A136439.
a(n) is the total number of levels visited by all Dyck paths of semilength n. - Alois P. Heinz, Apr 14 2024
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..650
N. Dershowitz and C. Rinderknecht, The Average Height of Catalan Trees by Counting Lattice Paths, Math. Mag., 88 (No. 3, 2015), 187-195.
MAPLE
# Maple code for Equations (1) and (2) of Dershowitz and Rinderknecht (2015).
H:=proc(n, h) local b, k; b:=binomial; add(b(2*n, n+1-k*h)-2*b(2*n, n-k*h)+b(2*n, n-1-k*h), k=1..n+1); end;
S1:=n->add(H(n, h), h=1..n+1); [seq(S1(n), n=0..30)];
MATHEMATICA
b[x_, y_, h_] := b[x, y, h] = If[x == 0, h, Sum[If[x+j > y, b[x-1, y-j, Max[h, y-j]], 0], {j, Range[-1, Min[1, y]]~Complement~{0}}]];
a[n_] := b[2n, 0, 0] + CatalanNumber[n];
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Aug 12 2015
STATUS
approved