OFFSET
0,2
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
Moa Apagodu and Doron Zeilberger, FIVE Applications of Wilf-Zeilberger Theory to Enumeration and Probability; Local copy [Pdf file only, no active links]
M. Apagodu and D. Zeilberger, Maple package to generate recurrence; Local copy
M. Apagodu and D. Zeilberger, 6th order recurrence; Local copy
EXAMPLE
a(1) = 2 because the number of ways of getting the score to be (1,1) is
(0,0) -> (1,0) -> (1,1),
(0,0) -> (0,1) -> (1,1).
MAPLE
b:= proc(x, y) option remember; `if`(x<0 or y<0, 0,
`if`([x, y]=[0, 0], 1, add(b(x-i, y) +b(x, y-i), i=1..3)))
end:
a:= n-> b(n, n):
seq(a(n), n=0..30); # Alois P. Heinz, Jul 24 2011
MATHEMATICA
b[x_, y_] := b[x, y] = If[x < 0 || y < 0, 0, If[{x, y} == {0, 0}, 1, Sum[b[x - i, y] + b[x, y - i], {i, 3}]]];
a[n_] := b[n, n];
a /@ Range[0, 30] (* Jean-François Alcover, May 13 2020, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn,walk
AUTHOR
Doron Zeilberger, Oct 20 2006
STATUS
approved