OFFSET
0,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..100
A. Bostan and M. Kauers, Automatic Classification of Restricted Lattice Walks, arXiv:0811.2899 [math.CO], 2008.
MAPLE
N:= 30: # to get a(0) to a(N)
steps:= [[-1, -1, 0], [-1, 0, -1], [0, -1, 0], [1, 1, -1], [1, 1, 1]]:
P[0]:= {[0, 0, 0]}:
A[0]:= 1:
B[0, [0, 0, 0]]:= 1:
for n from 1 to N do
A[n]:= 0:
P[n]:= {}:
for p in P[n-1] do
for s in steps do
pp:= p + s;
if min(pp) < 0 then next fi;
P[n]:= P[n] union {pp};
A[n]:= A[n] + B[n-1, p];
if assigned(B[n, pp]) then B[n, pp]:= B[n, pp] + B[n-1, p]
else B[n, pp]:= B[n-1, p]
fi;
od
od
od:
seq(A[n], n=0..N); # Robert Israel, Nov 03 2014
# second Maple program:
b:= proc(n, l) option remember; `if`(n=0, 1, add((p->
`if`(min(p[])<0, 0, b(n-1, p)))(l+h), h=[[-1$2, 0],
[-1, 0, -1], [0, -1, 0], [1$2, -1], [1$3]]))
end:
a:= n-> b(n, [0$3]):
seq(a(n), n=0..30); # Alois P. Heinz, Nov 04 2014
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, -1 + j, -1 + k, -1 + n] + aux[-1 + i, -1 + j, 1 + k, -1 + n] + aux[i, 1 + j, k, -1 + n] + aux[1 + i, j, 1 + k, -1 + n] + aux[1 + i, 1 + 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