%I #21 Oct 03 2021 16:49:56
%S 1,0,21,180,3699,78186,1763689,40219584,921030783,21114454518,
%T 484210273013,11105346505100,254708804007115,5841980066693506,
%U 133991588716915713,3073232605116594392,70487720404861582487,1616707836356340649102,37080846132267449237645
%N Number of n-move queen paths on 8x8 board from given corner to same corner.
%H Alois P. Heinz, <a href="/A025604/b025604.txt">Table of n, a(n) for n = 0..736</a>
%F From _Vaclav Kotesovec_, Nov 26 2012: (Start)
%F G.f.: ((-1+3*x)*(-1 + 65*x - 1704*x^2 + 23568*x^3 - 178704*x^4 + 576430*x^5 + 1641524*x^6 - 22152084*x^7 + 63390443*x^8 + 107381625*x^9 - 1072548108*x^10 + 1604228092*x^11 + 5065000686*x^12 - 19304907936*x^13 + 3650528536*x^14 + 75404779968*x^15 - 99704483296*x^16 - 97719166208*x^17 + 292843382912*x^18 - 76390477824*x^19 - 291118184448*x^20 + 242903138304*x^21 + 32643219456*x^22 - 93923573760*x^23 + 24970788864*x^24))/((1 - 8*x - 14*x^2 + 152*x^3 + 49*x^4 - 816*x^5 - 36*x^6 + 1152*x^7)*(-1 + 40*x - 482*x^2 + 2120*x^3 + 79*x^4 - 26128*x^5 + 55636*x^6 + 29184*x^7 - 170880*x^8 + 112896*x^9)*( - 1 + 20*x - 130*x^2 + 168*x^3 + 1375*x^4 - 4652*x^5 - 348*x^6 + 15472*x^7 - 10816*x^8 - 7296*x^9 + 4608*x^10)).
%F a(n+1)/a(n) tends to 22.936022136221...
%F (End)
%p b:= proc(n, i, j) option remember;
%p `if`(n<0 or i<0 or i>7 or j<0 or j>7, 0, `if`({n, i, j}={0},
%p 1, add(add(b(n-1, i+t*r[1], j+t*r[2]), r=[[1, 1],
%p [1, -1], [-1, 1], [-1, -1], [0, 1], [0, -1], [1, 0],
%p [-1, 0]]), t=1..7)))
%p end:
%p a:= n-> b(n, 0, 0):
%p seq(a(n), n=0..20); # _Alois P. Heinz_, Jun 28 2012
%t b[n_, i_, j_] := b[n, i, j] = If[n<0 || i<0 || i>7 || j<0 || j>7, 0, If[Union[{n, i, j}] == {0}, 1, Sum[Sum[b[n-1, i+t*r[[1]], j+t*r[[2]]], {r, {{1, 1}, {1, -1}, {-1, 1}, {-1, -1}, {0, 1}, {0, -1}, {1, 0}, {-1, 0}}}], {t, 1, 7}]]]; a[n_] := b[n, 0, 0]; Table[a[n], {n, 0, 30}] (* _Jean-François Alcover_, May 28 2015, after _Alois P. Heinz_ *)
%K nonn,easy
%O 0,3
%A _David W. Wilson_