%I #18 Oct 09 2019 13:35:30
%S 1,1,2,5,16,51,186,675,2619,10222,41278,168322,699654,2936170,
%T 12472461,53415773,230718087,1003219186,4390238536,19317023478,
%U 85423978859,379448391283,1692394492863,7576241773049,34031365237595,153338751409238,692894165597139
%N Number of self-avoiding planar walks starting at (0,0), ending at (n,0), remaining in the first quadrant and using steps (0,1), (1,0), (1,1), (-1,1), and (1,-1) with the restrictions that (0,1) and (1,-1) are never used above the diagonal and (1,0) and (-1,1) are never used below the diagonal and (1,1) can only be used below the diagonal.
%H Alois P. Heinz, <a href="/A303477/b303477.txt">Table of n, a(n) for n = 0..1470</a>
%H Alois P. Heinz, <a href="/A303477/a303477.gif">Animation of a(6)=186 walks</a>
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Lattice_path">Lattice path</a>
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Self-avoiding_walk">Self-avoiding walk</a>
%p b:= proc(x, y) option remember; `if`(x<0 or y<0, 0,
%p `if`(x=0 and y=0, 1, `if`(x>y-2, b(x, y-1), 0)+
%p `if`(x<y+2, b(x-1, y), 0)+`if`(x>y, b(x-1, y-1), 0)+
%p `if`(x<y-1, b(x+1, y-1), 0)+`if`(x>y+1, b(x-1, y+1), 0)))
%p end:
%p a:= n-> b(n, 0):
%p seq(a(n), n=0..30);
%t b[x_, y_] := b[x, y] = If[x < 0 || y < 0, 0,
%t If[x == 0 && y == 0, 1, If[x > y - 2, b[x, y - 1], 0] +
%t If[x < y + 2, b[x - 1, y], 0] + If[x > y, b[x - 1, y - 1], 0] +
%t If[x < y - 1, b[x + 1, y - 1], 0] + If[x > y + 1, b[x - 1, y + 1], 0]]];
%t a[n_] := b[n, 0];
%t Table[a[n], {n, 0, 30}] (* _Jean-François Alcover_, Jun 02 2018, from Maple *)
%Y Cf. A303478.
%K nonn,walk
%O 0,3
%A _Alois P. Heinz_, Apr 24 2018