OFFSET
0,3
COMMENTS
If the constraint is removed that the sequence does not reach (0,0) at any point other than the beginning and end of the sequence, this sequence becomes A005789.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..707
Marshall Hamon, A364439.c
FORMULA
From Alois P. Heinz, Jul 29 2023: (Start)
INVERTi transform of A005789.
a(n) mod 2 = A011655(n+1). (End)
EXAMPLE
Let A represent the (1,1) step, B represent the (1,-1) step, and C represent the (-2,0) step.
For n = 1, the only valid path is ABC.
For n = 2, the 4 valid paths are AABBCC, AABCBC, ABABCC, ABACBC.
MAPLE
b:= proc(n, l) option remember; `if`(n<1, 1, add((h->
`if`(h[2]>h[1] or h[1]>=n or min(h)<0 or n>1 and h=[0$2],
0, b(n-1, h)))(l-w), w=[[1, 1], [1, -1], [-2, 0]]))
end:
a:= n-> b(3*n-1, [2, 0]):
seq(a(n), n=0..25); # Alois P. Heinz, Jul 28 2023
# second Maple program:
f:= proc(n) option remember; (3*n)!*mul(i!/(n+i)!, i=0..2) end:
a:= proc(n) option remember; `if`(n=0, 1,
f(n)-add(f(n-i)*a(i), i=1..n-1))
end:
seq(a(n), n=0..25); # Alois P. Heinz, Jul 29 2023
MATHEMATICA
f[n_] := f[n] = (3n)!*Product[i!/(n+i)!, {i, 0, 2}];
a[n_] := a[n] = If[n == 0, 1, f[n] - Sum[f[n-i]*a[i], {i, 1, n-1}]];
Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Oct 27 2023, after Alois P. Heinz *)
PROG
(C) /* See Hamon Link */
CROSSREFS
KEYWORD
nonn,walk
AUTHOR
Marshall Hamon, Jul 24 2023
EXTENSIONS
More terms from Alois P. Heinz, Jul 27 2023
STATUS
approved