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

%I #11 Mar 29 2024 19:56:57

%S 1,1,3,8,28,91,330,1158,4301,15704,59202,221160,842264,3192043,

%T 12246092,46861680,180776672,696518376,2698468580,10449533172,

%U 40622230498,157911491626,615583136488,2400206401102,9378223581365,36655425305228,143499450616324,561998883034538,2203752597514260

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

%H Robert Israel, <a href="/A148849/b148849.txt">Table of n, a(n) for n = 0..220</a>

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

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

%p f:= proc(n, p) option remember;

%p if n <= min(p) then return 4^n fi;

%p add(procname(n-1,t),t=remove(has, map(`+`,Steps,p),-1));

%p end proc:

%p map(f, [$0..40],[0,0,0]); # _Robert Israel_, May 01 2018

%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, j, -1 + k, -1 + n] + aux[-1 + i, 1 + j, -1 + k, -1 + n] + aux[1 + i, j, -1 + 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