login
Number of lattice paths from (0,0) to (n,0) that do not go below the x-axis or above the diagonal x=y and consist of steps u=(1,1), U=(1,3), H=(1,0), d=(1,-1) and D=(1,-3).
4

%I #16 Dec 20 2020 12:41:54

%S 1,1,2,4,12,34,118,396,1508,5670,22773,91337,381157,1597683,6855957,

%T 29599117,129748149,572349631,2551033858,11435935450,51651644306,

%U 234472103672,1070461943299,4908349870799,22607570625188,104515879798724,484955119433493

%N Number of lattice paths from (0,0) to (n,0) that do not go below the x-axis or above the diagonal x=y and consist of steps u=(1,1), U=(1,3), H=(1,0), d=(1,-1) and D=(1,-3).

%H Alois P. Heinz, <a href="/A240904/b240904.txt">Table of n, a(n) for n = 0..1000</a>

%F a(n) ~ c * 5^n / n^(3/2), where c = 0.027245791342943908483296328462... . - _Vaclav Kotesovec_, Aug 28 2014

%e a(0) = 1: the empty path.

%e a(1) = 1: H.

%e a(2) = 2: HH, ud.

%e a(3) = 4: HHH, udH, Hud, uHd.

%e a(4) = 12: HHHH, udHH, HudH, uHdH, HHud, udud, HuHd, uHHd, uudd, HHUD, udUD, uuuD.

%e a(5) = 34: HHHHH, udHHH, HudHH, uHdHH, HHudH, ududH, HuHdH, uHHdH, uuddH, HHUDH, udUDH, uuuDH, HHHud, udHud, Hudud, uHdud, HHuHd, uduHd, HuHHd, uHHHd, uudHd, Huudd, uHudd, uuHdd, HHHUD, udHUD, HudUD, uHdUD, HuuuD, uHuuD, uuHuD, HHUHD, udUHD, uuuHD.

%p b:= proc(x, y) option remember; `if`(y<0 or x<y, 0,

%p `if`(x=0, 1, add(b(x-1, y+j), j=[-1, -3, 0, 1, 3])))

%p end:

%p a:= n-> b(n, 0):

%p seq(a(n), n=0..30);

%t b[x_, y_] := b[x, y] = If[y<0 || x<y, 0, If[x==0, 1, Sum[b[x-1, y+j], {j, {-1, -3, 0, 1, 3}}]]];

%t a[n_] := b[n, 0];

%t a /@ Range[0, 30] (* _Jean-François Alcover_, Dec 20 2020, after _Alois P. Heinz_ *)

%Y Cf. A001006 (without steps U, D), A127902 (without steps U, d), A247748.

%Y Row sums of A247749.

%K nonn

%O 0,3

%A _Alois P. Heinz_, Apr 14 2014