OFFSET
0,5
LINKS
Robert Israel, Table of n, a(n) for n = 0..1000
A. Bostan, K. Raschel, and B. Salvy, Non-D-finite excursions in the quarter plane, J. Comb. Theory A 121 (2014) 45-63, Table 1 Tag 21, Tag 33.
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:
map(f, [$0..40], [0, 0]); # Robert Israel, Nov 20 2023
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
Manuel Kauers, Nov 18 2008
STATUS
approved
