%I #19 Oct 24 2023 12:39:59
%S 1,1,2,2,4,5,11,17,38,67,148,282,616,1231,2674,5511,11957,25162,54673,
%T 116748,254393,549035,1200429,2611594,5730385,12544520,27620602,
%U 60766999,134232576,296533559,657000238,1456401504,3235647966,7193884621,16022254616,35714681625
%N Number of excursions of length n with Motzkin-steps avoiding the consecutive steps UH and HU.
%C The Motzkin step set is U=(1,1), H=(1,0) and D=(1,-1). An excursion is a path starting at (0,0), ending at (n,0) and never crossing the x-axis, i.e., staying at nonnegative altitude.
%H Michael De Vlieger, <a href="/A329701/b329701.txt">Table of n, a(n) for n = 0..2743</a>
%H Andrei Asinowski, Cyril Banderier, and Valerie Roitner, <a href="https://lipn.univ-paris13.fr/~banderier/Papers/several_patterns.pdf">Generating functions for lattice paths with several forbidden patterns</a>, preprint, 2019.
%H Helmut Prodinger, <a href="https://arxiv.org/abs/2310.12497">Motzkin paths of bounded height with two forbidden contiguous subwords of length two</a>, arXiv:2310.12497 [math.CO], 2023.
%F G.f.: (1 - t + t^3 - sqrt(1-2*t-3*t^2+6*t^3-2*t^4+t^6))/(2*t^2*(1-t)).
%F G.f. A(x) satisfies: A(x) = x / (1 - x) + 1 / (1 - x^2 * A(x)). - _Ilya Gutkovskiy_, Nov 03 2021
%e a(4)=4 since we have 4 excursions of length 4, namely: UUDD, UDUD, UDHH and HHHH.
%t CoefficientList[Series[(1 - x + x^3 - Sqrt[1 - 2 x - 3 x^2 + 6 x^3 - 2 x^4 + x^6])/(2 x^2*(1 - x)), {x, 0, 35}], x] (* _Michael De Vlieger_, Dec 27 2019 *)
%o (PARI) Vec((1 - x + x^3 - sqrt(1-2*x-3*x^2+6*x^3-2*x^4+x^6+O(x^40)))/(2*x^2*(1-x))) \\ _Andrew Howroyd_, Dec 20 2019
%Y Cf. A329702.
%K nonn,walk
%O 0,3
%A _Valerie Roitner_, Dec 16 2019