A371964 a(n) is the sum of all symmetric valleys in the set of Catalan words of length n.
0, 0, 0, 0, 1, 7, 35, 155, 650, 2652, 10660, 42484, 168454, 665874, 2627130, 10353290, 40775045, 160534895, 631970495, 2487938015, 9795810125, 38576953505, 151957215305, 598732526105, 2359771876175, 9303298456451, 36688955738099, 144732209103699, 571117191135799
Offset: 0
Keywords
Examples
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.).
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.
Programs
-
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]
-
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