OFFSET
0,2
COMMENTS
A Motzkin meander is a lattice path with steps from the set {D=-1, H=0, U=1} that starts at (0,0), and never goes below the x-axis.
A peak is an occurrence of the pattern UD.
A hump is an occurrence of the pattern UHH...HD (the number of Hs in the pattern is not fixed, and can be 0).
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..2100
Andrei Asinowski, Axel Bacher, Cyril Banderier, Bernhard Gittenberger, Analytic combinatorics of lattice paths with forbidden patterns, the vectorial kernel method, and generating functions for pushdown automata, Algorithmica (2019).
FORMULA
G.f.: ( (-1+4*t-3*t^2+sqrt(-3*t^4+4*t^3+2*t^2-4*t+1))/(3*t^2-4*t+1) + (-1+4*t-5*t^2+2*t^3+sqrt(4*t^6-12*t^5+13*t^4-8*t^3+6*t^2-4*t+1))/(-2*t^3+5*t^2-4*t+1) + (-1+4*t-5*t^2+sqrt(5*t^4-4*t^3+6*t^2-4*t+1))/(5*t^2-4*t+1) + (-1+4*t-3*t^2-2*t^3+sqrt(4*t^6+4*t^5-11*t^4+8*t^3+2*t^2-4*t+1))/(2*t^3+3*t^2-4*t+1) ) / (8*t).
a(n) ~ 3^(n + 1/2) / (4*sqrt(Pi*n)). - Vaclav Kotesovec, Jul 03 2019
EXAMPLE
For n=0, 1, 2, 3 there are 2^n paths: all the paths without D (0 humps, 0 peaks).
For example, for n=3: UUU, UUH, UHU, UHH, HUU, HUH, HHU, HHH.
For n=4, the "extra" path is UDUD (2 humps, 2 peaks).
The smallest example with #(humps) <> #(peaks) is UHDUHD (2 humps, 0 peaks).
MAPLE
b:= proc(x, y, t, p, h) option remember; `if`(x=0, `if`(p+h=0, 1, 0),
`if`(y>0, b(x-1, y-1, 0, irem(p+`if`(t=1, 1, 0), 2), irem(h+
`if`(t=2, 1, 0), 2)), 0)+b(x-1, y, `if`(t>0, 2, 0), p, h)+
b(x-1, y+1, 1, p, h))
end:
a:= n-> b(n, 0$4):
seq(a(n), n=0..35); # Alois P. Heinz, Jul 03 2019
MATHEMATICA
CoefficientList[Series[(1/(8*x))*((-1 + 4*x - 3*x^2 + Sqrt[(-(-1 + x)^2)* (-1 + 2*x + 3*x^2)])/ (1 - 4*x + 3*x^2) - (-1 + 4*x - 5*x^2 + 2*x^3 + Sqrt[(-1 + x)^3*(-1 + x + 4*x^3)])/((-1 + x)^2* (-1 + 2*x)) + (-1 + 4*x - 5*x^2 + Sqrt[1 - 4*x + 6*x^2 - 4*x^3 + 5*x^4])/ (1 - 4*x + 5*x^2) + (-1 + 4*x - 3*x^2 - 2*x^3 + Sqrt[1 - 4*x + 2*x^2 + 8*x^3 - 11*x^4 + 4*x^5 + 4*x^6])/(1 - 4*x + 3*x^2 + 2*x^3)), {x, 0, 30}], x] (* Vaclav Kotesovec, Jul 03 2019 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Andrei Asinowski, Jun 27 2019
STATUS
approved