login
A172361
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, 0), (1, 1)}.
1
1, 0, 3, 6, 38, 160, 905, 4830, 28308, 166992, 1024758, 6389460, 40724244, 263385408, 1728855843, 11484066594, 77130790880, 523010474272, 3577392455780, 24659960867256, 171191809159176, 1196062991373120, 8405598880928158, 59390108287965884, 421702103951853232
OFFSET
0,3
LINKS
M. Bousquet-Mélou and M. Mishna, 2008. Walks with small steps in the quarter plane, ArXiv 0810.4387.
FORMULA
G.f.: (1-2*t)*Int(hypergeom([1/2, 1/2], [2], 16*t*(t+1)/(1+4*t)^2 /(1-2*t)^2, t)/t^2 - 1/t. - Mark van Hoeij, Oct 31 2012
MAPLE
b:= proc(n, l) option remember; `if`(min(l[])<0 or n<max(l[]), 0,
`if`(n=0, 1, add(b(n-1, l-d), d=[[-1, -1], [-1, 0], [-1, 1],
[0, -1], [0, 1], [1, -1], [1, 0], [1, 1]])))
end:
a:= n-> b(n, [0$2]):
seq(a(n), n=0..30); # Alois P. Heinz, Jul 22 2012
# second Maple program
a:= proc(n) option remember; `if`(n<4, [1, 0, 3, 6][n+1],
((n-1)*(n+1)*(9*n^2+9*n+4) *a(n-1)
+4*(3*n-2)*(n-1)*(9*n^2+5*n-1) *a(n-2)
+32*n*(n-1)*(n-2)*(3*n+2) *a(n-3))/ ((n+1)*(3*n-1)*(n+2)^2))
end:
seq(a(n), n=0..30); # Alois P. Heinz, Oct 31 2012
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[ -1 + i, j, -1 + 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
Cf. A025596.
Sequence in context: A355544 A359968 A025596 * A114038 A000222 A372017
KEYWORD
nonn,easy
AUTHOR
Manuel Kauers, Feb 01 2010
STATUS
approved