This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A371965 #41 Jun 20 2025 11:15:19 %S A371965 0,0,0,1,6,27,111,441,1728,6733,26181,101763,395693,1539759,5997159, %T A371965 23381019,91244934,356427459,1393585779,5453514729,21358883439, %U A371965 83718027429,328380697629,1288947615849,5062603365999,19896501060225,78239857877649,307831771279549,1211767933187601 %N A371965 a(n) is the sum of all peaks in the set of Catalan words of length n. %H A371965 Alois P. Heinz, <a href="/A371965/b371965.txt">Table of n, a(n) for n = 0..1000</a> %H A371965 Jean-Luc Baril, Pamela E. Harris, Kimberly J. Harry, Matt McClinton, and José L. Ramírez, <a href="https://arxiv.org/abs/2404.05672">Enumerating runs, valleys, and peaks in Catalan words</a>, arXiv:2404.05672 [math.CO], 2024. See Corollary 4.7, p. 19. %F A371965 G.f.: (1 - 3*x - (1 - x)*sqrt(1 - 4*x))/(2*(1 - x)*sqrt(1 - 4*x)). %F A371965 a(n) = Sum_{i=1..n-1} binomial(2*(n-i)-1,n-i-2). %F A371965 a(n) ~ 2^(2*n)/(6*sqrt(Pi*n)). %F A371965 a(n)/A371963(n) ~ 1. %F A371965 a(n) - a(n-1) = A002054(n-2). %F A371965 From _Mélika Tebni_, Jun 15 2024: (Start) %F A371965 E.g.f.: (exp(2*x)*BesselI(0,2*x)-1)/2 - exp(x)*Integral_{x=-oo..oo} BesselI(0,2*x)*exp(x) dx. %F A371965 a(n) = binomial(2*n,n)*(1/2 + hypergeom([1,n+1/2],[n+1],4)) + i/sqrt(3) - 0^n/2. %F A371965 a(n) = (3*A106191(n) + A006134(n) + 4*0^n) / 8. %F A371965 a(n) = A281593(n) - (A000984(n) + 0^n) / 2. (End) %F A371965 Binomial transform of A275289. - _Alois P. Heinz_, Jun 20 2025 %e A371965 a(3) = 1 because there is 1 Catalan word of length 3 with one peak: 010. %e A371965 a(4) = 6 because there are 6 Catalan words of length 4 with one peak: 0010, 0100, 0101, 0110, 0120, and 0121 (see Figure 10 at p. 19 in Baril et al.). %p A371965 a:= proc(n) option remember; `if`(n<3, 0, %p A371965 a(n-1)+binomial(2*n-3, n-3)) %p A371965 end: %p A371965 seq(a(n), n=0..28); # _Alois P. Heinz_, Apr 15 2024 %p A371965 # Second Maple program: %p A371965 A371965 := series((exp(2*x)*BesselI(0,2*x)-1)/2-exp(x)*(int(BesselI(0,2*x)*exp(x), x)), x = 0, 29): %p A371965 seq(n!*coeff(A371965, x, n), n = 0 .. 28); # _Mélika Tebni_, Jun 15 2024 %t A371965 CoefficientList[Series[(1-3x-(1-x)Sqrt[1-4x])/(2(1-x) Sqrt[1-4x]),{x,0,28}],x] %o A371965 (Python) %o A371965 from math import comb %o A371965 def A371965(n): return sum(comb((n-i<<1)-3,n-i-3) for i in range(n-2)) # _Chai Wah Wu_, Apr 15 2024 %Y A371965 Cf. A371963, A371964. %Y A371965 Cf. A002054, A275289. %K A371965 nonn %O A371965 0,5 %A A371965 _Stefano Spezia_, Apr 14 2024