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

A151367
Number of walks within N^2 (the first quadrant of Z^2) starting and ending at (0,0) and consisting of n steps taken from {(-1, -1), (-1, 0), (-1, 1), (0, -1), (0, 1), (1, 1)}.
1
1, 0, 2, 2, 13, 27, 140, 392, 1882, 6289, 28906, 107949, 486438, 1948638, 8730438, 36611160, 164259758, 710530289, 3203433595, 14163150429, 64260242637, 288694503092, 1318679597635, 5996837692998, 27572301084897, 126595556379751, 585652882733959, 2709967750078764, 12607711205847168
OFFSET
0,3
LINKS
A. Bostan, K. Raschel, and B. Salvy, Non-D-finite excursions in the quarter plane, J. Comb. Theory A 121 (2014) 45-63, Table 1 Tag 43, Tag 49.
Mireille Bousquet-Mélou and Marni Mishna, Walks with small steps in the quarter plane, arXiv:0810.4387 [math.CO], 2008-2009.
MAPLE
Steps:= [[-1, -1], [-1, 0], [-1, 1], [0, -1], [0, 1], [1, 1]]:
f:= proc(n, p) option remember; local t, s;
if max(p) > n then return 0 fi;
add(procname(n-1, s), s = select(t -> min(t)>=0, map(`+`, Steps, p)))
end proc:
f(0, [0, 0]):= 1:
map(f, [$0..40], [0, 0]); # Robert Israel, Aug 02 2024
MATHEMATICA
aux[i_Integer, j_Integer, n_Integer] := Which[Min[i, j, n] < 0 || Max[i, j] > n, 0, n == 0, KroneckerDelta[i, j, n], True, aux[i, j, n] = aux[-1 + i, -1 + j, -1 + n] + aux[i, -1 + j, -1 + n] + aux[i, 1 + j, -1 + n] + aux[1 + i, -1 + j, -1 + n] + aux[1 + i, j, -1 + n] + aux[1 + i, 1 + j, -1 + n]]; Table[aux[0, 0, n], {n, 0, 25}]
CROSSREFS
Sequence in context: A151352 A155915 A173466 * A368957 A057648 A282460
KEYWORD
nonn,walk
AUTHOR
Manuel Kauers, Nov 18 2008
STATUS
approved