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 A191391 #18 Jul 24 2022 13:18:41 %S A191391 0,1,1,3,5,12,22,49,93,200,386,814,1586,3304,6476,13381,26333,54096, %T A191391 106762,218386,431910,880616,1744436,3547658,7036530,14281072, %U A191391 28354132,57451164,114159428,230993296,459312152,928319149,1846943453,3729244576,7423131482,14975907754 %N A191391 Number of horizontal segments in all dispersed Dyck paths of length n (i.e., in all Motzkin paths of length n with no (1,0)-steps at positive heights; a horizontal segment is a maximal sequence of consecutive (1,0)-steps). %F A191391 a(n) = Sum_{k>=0} k*A191390(n,k). %F A191391 G.f.: g(z) = 4*z*(1-z)/(1-2*z+sqrt(1-4*z^2))^2. %F A191391 a(0)=0 and a(n)=2^(n-1)-C(n-1,floor(n/2)-1) for n>=1. [_Joerg Arndt_, Aug 07 2012, aeb] %F A191391 D-finite with recurrence (n+1)*a(n) +(-3*n-1)*a(n-1) +2*(-n+3)*a(n-2) +4*(3*n-8)*a(n-3) +8*(-n+4)*a(n-4)=0. - _R. J. Mathar_, Jul 24 2022 %e A191391 a(4)=5 because in (HHHH), (HH)UD, (H)UD(H), UD(HH), UDUD, and UUDD we have a total of 1+1+2+1+0+0=5 horizontal segments (shown between parentheses). %p A191391 g := 4*z*(1-z)/(1-2*z+sqrt(1-4*z^2))^2: gser := series(g, z = 0, 40): seq(coeff(gser, z, n), n = 0 .. 35); %Y A191391 Cf. A191390. %Y A191391 First differences of A045621. %K A191391 nonn %O A191391 0,4 %A A191391 _Emeric Deutsch_, Jun 03 2011