OFFSET
0,6
LINKS
Jean-Luc Baril, Pamela E. Harris, Kimberly J. Harry, Matt McClinton, and José L. Ramírez, Enumerating runs, valleys, and peaks in Catalan words, arXiv:2404.05672 [math.CO], 2024. See Corollary 4.7, pp. 16-17.
FORMULA
EXAMPLE
a(4) = 1 because there is 1 Catalan word of length 4 with one symmetric valley: 0101.
a(5) = 7 because there are 7 Catalan words of length 5 with one symmetric valley: 00101, 01001, 01010, 01011, 01012, 01101, and 01212 (see example at p. 16 in Baril et al.).
MAPLE
a:= proc(n) option remember; `if`(n<4, 0,
a(n-1)+binomial(2*n-4, n-4))
end:
seq(a(n), n=0..28); # Alois P. Heinz, Apr 15 2024
MATHEMATICA
CoefficientList[Series[(1-4x+2x^2-(1-2x)Sqrt[1-4x])/(2(1-x) Sqrt[1-4x]), {x, 0, 29}], x]
PROG
(Python)
from math import comb
def A371964(n): return sum(comb((n-i<<1)-4, n-i-4) for i in range(n-3)) # Chai Wah Wu, Apr 15 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Stefano Spezia, Apr 14 2024
STATUS
approved