|
|
A151348
|
|
Number of walks within N^2 (the first quadrant of Z^2) starting and ending at (0,0) and consisting of n steps taken from {(-1, -1), (-1, 0), (-1, 1), (0, -1), (1, 0)}.
|
|
1
|
|
|
1, 0, 1, 1, 4, 7, 25, 64, 201, 612, 1961, 6355, 21026, 70968, 241810, 837191, 2925393, 10334302, 36813216, 132242756, 478470272, 1742816732, 6387201912, 23539830561, 87207544029, 324627673245, 1213820275167, 4557447698656, 17177881979810, 64981216839823, 246648317043660, 939184339480746, 3586940782960596
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,5
|
|
LINKS
|
M. Bousquet-Mélou and M. Mishna, 2008. Walks with small steps in the quarter plane, ArXiv 0810.4387.
|
|
MAPLE
|
Steps:= [[-1, -1], [-1, 0], [-1, 1], [0, -1], [1, 0]]:
f:= proc(n, p) option remember; local t, s;
if max(p) > n then return 0 fi;
add(procname(n-1, s), s = select(t -> min(t)>=0, map(`+`, Steps, p)))
end proc:
f(0, [0, 0]):= 1:
|
|
MATHEMATICA
|
aux[i_Integer, j_Integer, n_Integer] := Which[Min[i, j, n] < 0 || Max[i, j] > n, 0, n == 0, KroneckerDelta[i, j, n], True, aux[i, j, n] = aux[-1 + i, j, -1 + n] + aux[i, 1 + j, -1 + n] + aux[1 + i, -1 + j, -1 + n] + aux[1 + i, j, -1 + n] + aux[1 + i, 1 + j, -1 + n]]; Table[aux[0, 0, n], {n, 0, 25}]
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,walk
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|