OFFSET
0,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
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
KEYWORD
nonn,easy
AUTHOR
Manuel Kauers, Feb 01 2010
STATUS
approved