login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A149595
Number of walks within N^3 (the first octant of Z^3) starting at (0,0,0) and consisting of n steps taken from {(-1, -1, 0), (-1, 0, -1), (0, -1, 0), (1, 1, -1), (1, 1, 1)}.
1
1, 1, 5, 15, 59, 219, 921, 3729, 15511, 66307, 285723, 1231425, 5377117, 23746851, 104998531, 465502605, 2084418377, 9360389879, 42066742411, 189986019637, 861969546027, 3914101686361, 17807890803795, 81343463279557, 372217083213775, 1704575842549479, 7825997996053383, 36010679557986875
OFFSET
0,3
LINKS
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
Sequence in context: A149593 A230986 A149594 * A149596 A149597 A149598
KEYWORD
nonn,walk
AUTHOR
Manuel Kauers, Nov 18 2008
STATUS
approved