%I #33 May 14 2020 08:59:30
%S 1,5,31,258,2702,33821,492978,8198218,153136209,3173544162,
%T 72241986729,1791612993205,48074653669593,1387590910289915,
%U 42863756641047136,1410904918289665343,49296029555617568097,1822020250023113834772,71023629427964322798782
%N Total number of nodes summed over all 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) such that (0,1) is never used directly before or after (1,0) or (1,1).
%H Alois P. Heinz, <a href="/A320512/b320512.txt">Table of n, a(n) for n = 0..402</a>
%F a(n) ~ c * n! * 2^n * n^(7/4), where c = 0.1758027947... - _Vaclav Kotesovec_, May 14 2020
%p b:= proc(x, y, i) option remember; (l-> `if`(min(x, y)<0, 0,
%p `if`(max(x, y)=0, [1$2], add(`if`({i, j} in {{1, 2}, {3, 5},
%p {4, 5}}, 0, (p-> p+[0, p[1]])(b(x-l[j][1], y-l[j][2], j))),
%p j=1..5))))([[-1, 1], [1, -1], [1, 1], [1, 0], [0, 1]])
%p end:
%p a:= n-> b(n, 0$2)[2]:
%p seq(a(n), n=0..20);
%t b[x_, y_, i_] := b[x, y, i] = With[{l = {{-1, 1}, {1, -1}, {1, 1}, {1, 0}, {0, 1}}}, If[Min[x, y] < 0, {0, 0}, If[Max[x, y] == 0, {1, 1}, Sum[If[ MemberQ[{{1, 2}, {3, 5}, {4, 5}}, Sort@{i, j}], {0, 0}, Function[p, p + {0, p[[1]]}][b[x - l[[j]][[1]], y - l[[j]][[2]], j]]], {j, 5}]]]];
%t a[n_] := b[n, 0, 0][[2]];
%t a /@ Range[0, 20] (* _Jean-François Alcover_, May 14 2020, after Maple *)
%Y Cf. A317985.
%K nonn,walk
%O 0,2
%A _Alois P. Heinz_, Oct 22 2018
|