%I #29 Mar 22 2024 17:24:01
%S 4,2,16,44,256,768,5184,25344,186624,996480,8294400,57888000,
%T 530841600,4006195200,40642560000,367408742400,4064256000000,
%U 39358255104000,474054819840000,5254107586560000,68263894056960000,804207665479680000,11242684107325440000
%N Number of arrangements of n non-attacking bishops on an n X n board such that every square of the board is controlled by at least one bishop.
%H Vincenzo Librandi, <a href="/A122749/b122749.txt">Table of n, a(n) for n = 2..200</a>
%H R. W. Robinson, <a href="http://dx.doi.org/10.1007/BFb0097382">Counting arrangements of bishops</a>, pp. 198-214 of Combinatorial Mathematics IV (Adelaide 1975), Lect. Notes Math., 560 (1976). [E_n, n >= 2.]
%F From _Andy Huchala_, Mar 22 2024 (based on Mathematica code): (Start)
%F a(4*n) = (n+1)^2*((2*n)!)^2.
%F a(4*n+1) = (1/3)*(n+2)*(1+4*n+6*n^2)*((2*n)!)^2.
%F a(4*n+2) = 4*(n+1)^4*((2*n)!)^2.
%F a(4*n+3) = (1/3)*(3+17*n+22*n^2+6*n^3)*(2*n)!*(2*n+2)!. (End)
%p E:=proc(n) local k; if n mod 2 = 0 then k := n/2; if k mod 2 = 0 then RETURN( (k!*(k+2)/2)^2 ); else RETURN( ((k-1)!*(k+1)^2/2)^2 ); fi; else k := (n-1)/2; if k mod 2 = 0 then RETURN( ((k!)^2/12)*(3*k^3+16*k^2+18*k+8) ); else RETURN( ((k-1)!*(k+1)!/12)*(3*k^3+13*k^2-k-3) ); fi; fi; end;
%t Table[If[n==1,1,1/768*(2*(3*n^3+23*n^2+17*n+21)*(((n-1)/2)!)^2*(1-(-1)^n+2*Sin[(Pi*n)/2])-2*(3*n^3+17*n^2-47*n+3)*((n-3)/2)!*((n+1)/2)!*((-1)^n+2*Sin[(Pi*n)/2]-1)+3*(n+2)^4*((n/2-1)!)^2*((-1)^n-2*Cos[(Pi*n)/2]+1)+12*(n+4)^2*((n/2)!)^2*((-1)^n+2*Cos[(Pi*n)/2]+1))],{n,2,25}] (* _Vaclav Kotesovec_, Apr 26 2012 *)
%t a[n_] := Module[{k}, If[Mod[n, 2]==0, k = n/2; If[Mod[k, 2]==0, (k!*(k+2) /2)^2, ((k-1)!*(k+1)^2/2)^2], k = (n-1)/2; If[Mod[k, 2]==0, ((k!)^2/12)* (3*k^3+16*k^2+18*k+8), ((k-1)!*(k+1)!/12)*(3*k^3+13*k^2-k-3)]]];
%t Table[a[n], {n, 2, 25}] (* _Jean-François Alcover_, Jul 23 2022, after Maple code *)
%Y Cf. A005635, A182333.
%K nonn
%O 2,1
%A _N. J. A. Sloane_, Sep 25 2006
%E New name from _Vaclav Kotesovec_, Apr 26 2012