A225042
Number of lattice paths from (0,0) to (n,n) that do not go below the x-axis or above the diagonal x=y and consist of steps U=(1,1), D=(1,-1), H=(1,0) and S=(0,1).
Original entry on oeis.org
1, 2, 8, 48, 360, 3088, 28928, 288208, 3003952, 32402384, 359019952, 4064452272, 46829600704, 547498996736, 6480275672192, 77511461858592, 935562094075392, 11381614588917296, 139425068741674448, 1718444636265140992, 21295889048851102176, 265200380258393530896
Offset: 0
a(0) = 1: the empty path.
a(1) = 2: U, HS.
a(2) = 8: UU, HSU, UHS, HSHS, HUS, HHSS, UDSS, HSDSS.
-
b:= proc(x, y) option remember; `if`(y>x, 0, `if`(x=0, 1,
b(x-1, y)+`if`(y>0, b(x-1, y-1)+b(x, y-1), 0)+b(x-1, y+1)))
end:
a:= n-> b(n, n):
seq(a(n), n=0..25);
-
b[x_, y_] := b[x, y] = If[y > x, 0, If[x == 0, 1, b[x - 1, y] + If[y > 0, b[x - 1, y - 1] + b[x, y - 1], 0] + b[x - 1, y + 1]]];
a[n_] := b[n, n];
Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Mar 29 2017, translated from Maple *)
A114296
First row of Modified Schroeder numbers for q=3 (A114292).
Original entry on oeis.org
1, 1, 2, 5, 16, 57, 224, 934, 4092, 18581, 86888, 415856, 2029160, 10061161, 50568680, 257129888, 1320619176, 6842177174, 35722456976, 187772944964, 992991472328, 5279633960181, 28208037066528, 151373637844440, 815568695756496, 4410124252008112
Offset: 0
Christopher Hanusa (chanusa(AT)math.binghamton.edu), Nov 21 2005
The number of paths from (0,0) to (3,3) staying between the lines y=x and y=x/2 using steps of length (0,1), (1,0) and (1,1) is a(3)=5.
-
b:= proc(x, y) option remember; `if`(y>x or y b(n, n):
seq(a(n), n=0..30); # Alois P. Heinz, Apr 25 2013
-
b[x_, y_] := b[x, y] = If[y>x || yJean-François Alcover, Feb 05 2015, after Alois P. Heinz *)
A198324
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), D=(1,-1) and S=(0,1).
Original entry on oeis.org
1, 0, 1, 1, 4, 10, 35, 116, 427, 1584, 6146, 24216, 97754, 400080, 1662645, 6986127, 29669872, 127101015, 548839687, 2386211664, 10439207266, 45920497075, 203004397362, 901459381683, 4019351034816, 17987665701788, 80773320086286, 363842478143834
Offset: 0
a(4) = 4: UDSDSD, UDUD, UDSSDD, UUDD.
a(5) = 10: UDSDSDSD, UDUDSD, UDSSDDSD, UUDDSD, UDSDUD, UDSDSSDD, UDUSDD, UDSSDSDD, UUDSDD, UDSUDD.
-
b:= proc(x, y) option remember; `if`(y>x, 0, `if`(x=0, 1,
`if`(y>0, b(x, y-1)+b(x-1, y-1), 0)+b(x-1, y+1)))
end:
a:= n-> b(n, 0):
seq(a(n), n=0..30);
-
b[x_, y_] := b[x, y] = If[y>x, 0, If[x == 0, 1, If[y>0, b[x, y-1] + b[x-1, y-1], 0] + b[x-1, y+1]]]; a[n_] := b[n, 0]; Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Feb 05 2015, after Alois P. Heinz *)
A286760
Total number of nodes summed over all 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), D=(1,-1), H=(1,0) and S=(0,1).
Original entry on oeis.org
1, 2, 10, 42, 214, 1098, 5978, 33190, 189078, 1093490, 6414714, 38027030, 227489950, 1370980490, 8314674202, 50696630838, 310541818382, 1909850054666, 11786947172234, 72969941803662, 452976340653030, 2818815920369754, 17579546535174946, 109850944544149134
Offset: 0
-
b:= proc(x, y) option remember; `if`(y<0 or y>x, 0, `if`(x=0, [1$2],
(p-> p+[0, p[1]])(b(x-1, y)+b(x, y-1)+b(x-1, y-1)+b(x-1, y+1))))
end:
a:= n-> b(n, 0)[2]:
seq(a(n), n=0..30);
-
b[x_, y_] := b[x, y] = If[y<0 || y>x, 0, If[x == 0, {1, 1}, Function[
p, p+{0, p[[1]]}][b[x-1, y] + b[x, y-1] + b[x-1, y-1] + b[x-1, y+1]]]];
a[n_] := b[n, 0][[2]];
Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Jun 28 2022, after Alois P. Heinz *)
Showing 1-4 of 4 results.
Comments