login
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, 0, 1), (0, 1, 0), (1, 0, -1)}.
1

%I #8 Nov 05 2025 15:22:14

%S 1,2,5,14,46,159,577,2147,8290,32569,130736,531085,2192274,9130703,

%T 38470771,163216207,698704886,3007633571,13038423868,56779502954,

%U 248683781581,1093309818901,4829390034282,21400874540542,95212283347723,424764491338480,1901372644973656,8531453059744208

%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, 0, 1), (0, 1, 0), (1, 0, -1)}.

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

%H A. Bostan and M. Kauers, 2008. Automatic Classification of Restricted Lattice Walks, <a href="https://arxiv.org/abs/0811.2899">ArXiv 0811.2899</a>.

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

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

%p [-1, 0, 1], [0, 0, 1], [0, 1, 0], [1, 0, -1]]))

%p end:

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

%p seq(a(n), n=0..30); # _Alois P. Heinz_, Apr 13 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, j, 1 + k, -1 + n] + aux[i, -1 + j, k, -1 + n] + aux[i, j, -1 + 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,2

%A _Manuel Kauers_, Nov 18 2008