cp's OEIS Frontend

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.

A307572 Number of Motzkin meanders of length n with an odd number of humps.

Original entry on oeis.org

0, 0, 1, 5, 18, 56, 161, 443, 1196, 3228, 8823, 24579, 69810, 201380, 586843, 1719081, 5044584, 14800352, 43384747, 127076015, 372100654, 1089864344, 3194496987, 9372984609, 27532712140, 80966582548, 238342592353, 702222958797, 2070454005078, 6108341367004
Offset: 0

Views

Author

Andrei Asinowski, Apr 15 2019

Keywords

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 hump is an occurrence of the pattern UHH...HD (the number of Hs in the pattern is not fixed, and can be 0).

Examples

			For n = 3 the a(3) = 5 paths are UDH, HUD, UHD, UUD, UDU.
		

Crossrefs

Cf. A001006.

Programs

  • Maple
    b:= proc(x, y, t, c) option remember; `if`(y<0, 0, `if`(x=0, c,
          b(x-1, y-1, 0, irem(c+t, 2))+b(x-1, y, t, c)+b(x-1, y+1, 1, c)))
        end:
    a:= n-> b(n, 0$3):
    seq(a(n), n=0..35);  # Alois P. Heinz, Apr 16 2019
  • Mathematica
    b[x_, y_, t_, c_] := b[x, y, t, c] = If[y<0, 0, If[x==0, c, b[x-1, y-1, 0, Mod[c+t, 2]] + b[x-1, y, t, c] + b[x-1, y+1, 1, c]]];
    a[n_] := b[n, 0, 0, 0];
    Table[a[n], {n, 0, 35}] (* Jean-François Alcover, Apr 29 2019, after Alois P. Heinz *)

Formula

G.f.: (sqrt((1-t^2)/(1-4*t+3*t^2)) - sqrt((1+t^2)/(1-4*t+5*t^2))) / (4*t).
Conjecture: D-finite with recurrence -3*(n+1)*(n-2)*a(n) +12*(2*n^2-4*n-1)*a(n-1) +2*(-35*n^2+107*n-48)*a(n-2) +4*(21*n^2-89*n+80)*a(n-3) +4*(-5*n^2+32*n-43)*a(n-4) +4*(-8*n^2+62*n-115)*a(n-5) +2*(31*n^2-283*n+616)*a(n-6) -4*(23*n-97)*(n-6)*a(n-7) +15*(n-6)*(n-7)*a(n-8)=0. - R. J. Mathar, May 06 2020
a(n) ~ 3^(n + 1/2) / (2*sqrt(Pi*n)). - Vaclav Kotesovec, Mar 08 2023