OFFSET
0,3
LINKS
Robert Israel, Table of n, a(n) for n = 0..168
A. Bostan and M. Kauers, 2008. Automatic Classification of Restricted Lattice Walks, ArXiv 0811.2899.
MAPLE
f:= proc(a, b, c, n) option remember;
local t;
if n = 0 then return 1 fi;
t:= procname(a+1, b, c+1, n-1);
if a >= 1 then t:= t + procname(a-1, b, c, n-1) + procname(a-1, b, c+1, n-1) fi;
if c >= 1 then t:= t + procname(a, b+1, c-1, n-1) fi;
if b >= 1 then t:= t + procname(a+1, b-1, c+1, n-1) fi;
t;
end proc:
seq(f(0, 0, 0, n), n=0..50); # Robert Israel, Nov 07 2017
MATHEMATICA
aux[i_Integer, j_Integer, k_Integer, n_Integer] := Which[Min[i, j, k, n] < 0 || Max[i, j, k] > n, 0, n == 0, KroneckerDelta[i, j, k, n], True, aux[i, j, k, n] = aux[-1 + i, j, -1 + k, -1 + n] + aux[-1 + i, 1 + j, -1 + k, -1 + n] + aux[i, -1 + j, 1 + k, -1 + n] + aux[1 + i, j, -1 + k, -1 + n] + aux[1 + i, j, k, -1 + n]]; Table[Sum[aux[i, j, k, n], {i, 0, n}, {j, 0, n}, {k, 0, n}], {n, 0, 10}]
CROSSREFS
KEYWORD
nonn,walk
AUTHOR
Manuel Kauers, Nov 18 2008
STATUS
approved