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”).

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

%I #12 Nov 04 2014 17:34:22

%S 1,1,5,15,59,219,921,3729,15511,66307,285723,1231425,5377117,23746851,

%T 104998531,465502605,2084418377,9360389879,42066742411,189986019637,

%U 861969546027,3914101686361,17807890803795,81343463279557,372217083213775,1704575842549479,7825997996053383,36010679557986875

%N 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)}.

%H Alois P. Heinz, <a href="/A149595/b149595.txt">Table of n, a(n) for n = 0..100</a>

%H A. Bostan and M. Kauers, <a href="http://arxiv.org/abs/0811.2899">Automatic Classification of Restricted Lattice Walks</a>, arXiv:0811.2899 [math.CO], 2008.

%p N:= 30: # to get a(0) to a(N)

%p steps:= [[-1,-1,0],[-1,0,-1],[0,-1,0],[1,1,-1],[1,1,1]]:

%p P[0]:= {[0,0,0]}:

%p A[0]:= 1:

%p B[0,[0,0,0]]:= 1:

%p for n from 1 to N do

%p A[n]:= 0:

%p P[n]:= {}:

%p for p in P[n-1] do

%p for s in steps do

%p pp:= p + s;

%p if min(pp) < 0 then next fi;

%p P[n]:= P[n] union {pp};

%p A[n]:= A[n] + B[n-1,p];

%p if assigned(B[n,pp]) then B[n,pp]:= B[n,pp] + B[n-1,p]

%p else B[n,pp]:= B[n-1,p]

%p fi;

%p od

%p od

%p od:

%p seq(A[n],n=0..N); # _Robert Israel_, Nov 03 2014

%p # second Maple program:

%p b:= proc(n, l) option remember; `if`(n=0, 1, add((p->

%p `if`(min(p[])<0, 0, b(n-1, p)))(l+h), h=[[-1$2, 0],

%p [-1, 0, -1], [0, -1, 0], [1$2, -1], [1$3]]))

%p end:

%p a:= n-> b(n, [0$3]):

%p seq(a(n), n=0..30); # _Alois P. Heinz_, Nov 04 2014

%t 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}]

%K nonn,walk

%O 0,3

%A _Manuel Kauers_, Nov 18 2008