|
|
A277920
|
|
Number of positive walks with n steps {-4,-3,-2,-1,0,1,2,3,4} starting at the origin, ending at altitude 1, and staying strictly above the x-axis.
|
|
1
|
|
|
0, 1, 4, 20, 120, 780, 5382, 38638, 285762, 2162033, 16655167, 130193037, 1030117023, 8234025705, 66391916397, 539360587341, 4410492096741, 36274113675369, 299864297741292, 2490192142719336, 20764402240048267, 173784940354460219, 1459360304511145146
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
LINKS
|
|
|
MAPLE
|
b:= proc(n, y) option remember; `if`(n=0, `if`(y=1, 1, 0),
add((h-> `if`(h<1, 0, b(n-1, h)))(y+d), d=-4..4))
end:
a:= n-> b(n, 0):
|
|
MATHEMATICA
|
b[n_, y_] := b[n, y] = If[n == 0, If[y == 1, 1, 0], Sum[Function[h, If[h < 1, 0, b[n - 1, h]]][y + d], {d, -4, 4}]];
a[n_] := b[n, 0];
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,walk
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|