This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A346541 #22 Nov 04 2021 11:08:41 %S A346541 1,5,173,6273,327304,19662204,1331125733,97103842536,7486548949630, %T A346541 600824064355643,49716537270181030,4212436222856773156, %U A346541 363673201239600512658,31874623637580787947172,2828388650238276648013964,253555200931317108300020394,22925898959060646660438636660 %N A346541 Number of walks on square lattice from (n,2n) to (0,0) using steps that decrease the Euclidean distance to the origin and increase the Euclidean distance to (n,2n) and that change each coordinate by at most 1. %C A346541 Lattice points may have negative coordinates, and different walks may differ in length. All walks are self-avoiding. %H A346541 Alois P. Heinz, <a href="/A346541/b346541.txt">Table of n, a(n) for n = 0..200</a> %H A346541 Alois P. Heinz, <a href="/A346541/a346541.gif">Animation of a(2) = 173 walks</a> %H A346541 Wikipedia, <a href="https://en.wikipedia.org/wiki/Lattice_path#Counting_lattice_paths">Counting lattice paths</a> %H A346541 Wikipedia, <a href="https://en.wikipedia.org/wiki/Self-avoiding_walk">Self-avoiding walk</a> %F A346541 a(n) = A346540(2n,n) = A346540(n,2n). %p A346541 s:= proc(n) option remember; %p A346541 `if`(n=0, [[]], map(x-> seq([x[], i], i=-1..1), s(n-1))) %p A346541 end: %p A346541 b:= proc(l, v) option remember; (n-> `if`(l=[0$n], 1, add((h-> `if`( %p A346541 add(i^2, i=h)<add(i^2, i=l) and add(i^2, i=v-h)>add(i^2, i=v-l) %p A346541 , b(h, v), 0))(l+x), x=s(n))))(nops(l)) %p A346541 end: %p A346541 a:= n-> b([n, 2*n]$2): %p A346541 seq(a(n), n=0..20); %t A346541 s[n_] := s[n] = If[n == 0, {{}}, Sequence @@ %t A346541 Table[Append[#, i], {i, -1, 1}]& /@ s[n-1]]; %t A346541 b[l_, v_] := b[l, v] = With[{n = Length[l]}, %t A346541 If[l == Table[0, {n}], 1, Sum[With[{h = l + x}, %t A346541 If[h.h<l.l && (v-h).(v-h)>(v-l).(v-l), b[h, v], 0]], {x, s[n]}]]]; %t A346541 a[n_] := b[{n, 2n}, {n, 2n}]; %t A346541 Table[a[n], {n, 0, 20}] (* _Jean-François Alcover_, Nov 04 2021, after _Alois P. Heinz_ *) %Y A346541 Cf. A346540. %K A346541 nonn,walk %O A346541 0,2 %A A346541 _Alois P. Heinz_, Sep 16 2021