Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #13 Jul 24 2022 12:41:21
%S 0,0,1,4,13,38,108,304,857,2426,6902,19728,56622,163092,471205,
%T 1365008,3963321,11530786,33607190,98105616,286795300,839470664,
%U 2460038427,7216652488,21190820678,62279238828,183185851903,539220930004,1588341106957,4681678922366
%N Number of weak peaks in all Motzkin paths of length n. A weak peak of a Motzkin path is a vertex on the top of a hump. A hump is an upstep followed by 0 or more flatsteps followed by a downstep. For example, the Motzkin path u*duu*h*h*dd, where u=(1,1), h=(1,0), d(1,-1), has 4 weak peaks (shown by the stars).
%C a(n) = Sum(k*A247286(n,k), 0<=k<=n).
%H Alois P. Heinz, <a href="/A247287/b247287.txt">Table of n, a(n) for n = 0..1000</a>
%F G.f.: (1-z-sqrt(1-2*z-3*z^2))/(2*(1-z)^2*sqrt(1-2*z-3*z^2)).
%F a(n) ~ 3^(n+3/2) / (8*sqrt(Pi*n)). - _Vaclav Kotesovec_, Sep 16 2014
%F D-finite with recurrence n*a(n) +(-5*n+3)*a(n-1) +2*(3*n-4)*a(n-2) +2*(n-1)*a(n-3) +(-7*n+16)*a(n-4) +3*(n-3)*a(n-5)=0. - _R. J. Mathar_, Jul 24 2022
%e a(3)=4 because the Motzkin paths hhh, hu*d, u*dh, and u*h*d have 0, 1, 1, and 2 weak peaks (shown by the stars).
%p g := ((1-z-sqrt(1-2*z-3*z^2))*(1/2))/((1-z)^2*sqrt(1-2*z-3*z^2)): gser := series(g, z = 0, 34): seq(coeff(gser, z, n), n = 0 .. 32);
%o (PARI) z='z+O('z^66); concat([0,0],Vec((1-z-sqrt(1-2*z-3*z^2))/(2*(1-z)^2*sqrt(1-2*z-3*z^2)))) \\ _Joerg Arndt_, Sep 14 2014
%Y Cf. A001006, A247286.
%K nonn
%O 0,4
%A _Emeric Deutsch_, Sep 14 2014