Nonattacking Arrangements of Kings on Even Length Chessboard
Author
Tricia Brown
Title
Nonattacking Arrangements of Kings on Even Length Chessboard
Description
For very small n>1, the code computes the number of distinct, maximum, independent arrangements of kings on a 2n by 2n chessboard.
Category
Academic Articles & Supplements
Keywords
chess, independent arrangements
URL
http://www.notebookarchive.org/2022-02-0zki6rn/
DOI
https://notebookarchive.org/2022-02-0zki6rn
Date Added
2022-02-02
Date Last Modified
2022-02-02
File Size
14.8 kilobytes
Supplements
Rights
CC BY 4.0
![](/img/download-icon.png)
![](/img/Open-In-Cloud-icon.png)
![](/img/3-Dots.png)
This file contains supplementary data for Tricia Muldoon Brown, “MAXIMUM ARRANGEMENTS OF NONATTACKING KINGS ON THE 2n × 2n CHESSBOARD,” https://www.researchgate.net/publication/345816618_MAXIMUM_ARRANGEMENTS_OF_NONATTACKING_KINGS_ON_THE_2n_2n_CHESSBOARD.
Nonattacking Arrangements of Kings on Even Length Chessboard
Nonattacking Arrangements of Kings on Even Length Chessboard
Tricia Brown
Off[General::partw]ClearAll[S,n,m,C1,B1,A1,A2,p,q,f,r]n=4S:=Subsets[Range[n]]m:={}Do[AppendTo[m,Subsets[S[[i]]]],{i,1,2^n}]C1:={}Do[AppendTo[C1,{}],{i,1,2^n}]B1:={}Do[AppendTo[B1,C1],{i,1,2^n}]A1:={}Do[AppendTo[A1,B1],{i,1,2^n}]A2:={}Do[AppendTo[A2,B1],{i,1,2^n}]
Out[]=
4
Do[Do[Do[Do[For[j=1,j<n+1,j++,If[MemberQ[m[[i]],j,2],,If[MemberQ[m[[i,l]],j-1],If[j<k,AppendTo[A1[[i,l,k]],j]]]]],{k,1,n+1}],{l,1,2^p}],{i,Sum[Binomial[n,j],{j,0,p-1}]+1,Sum[Binomial[n,j],{j,0,p}]}],{p,0,n}]
p[x_,y_,z_]:=Max[A1[[x,y,z]],{1}]
Do[Do[Do[Do[For[j=1,j<n+1,j++,If[MemberQ[m[[i,l]],j],If[MemberQ[m[[i]],j-1,2],,If[j>k,AppendTo[A2[[i,l,k]],j]]]]],{k,1,n+1}],{l,1,2^p}],{i,Sum[Binomial[n,j],{j,0,p-1}]+1,Sum[Binomial[n,j],{j,0,p}]}],{p,0,n}]
q[x_,y_,z_]:=Min[A2[[x,y,z]],{n+1}]
f[x_,z_,1]:=Sum[Sum[r=1;While[m[[x,r]]≠m[[y,2^l]],r++];Sum[If[MemberQ[m[[x]],m[[y,2^l]]],1,0],{j,p[x,r,z],q[x,r,z]}],{y,Sum[Binomial[n,k],{k,0,l-1}]+1,Sum[Binomial[n,k],{k,0,l}]}],{l,0,n}]
Do[f[x_,z_,t_]:=Sum[Sum[r=1;While[m[[x,r]]≠m[[y,2^l]],r++];Sum[If[MemberQ[m[[x]],m[[y,2^l]]],f[y,j,t-1],0],{j,p[x,r,z],q[x,r,z]}],{y,Sum[Binomial[n,k],{k,0,l-1}]+1,Sum[Binomial[n,k],{k,0,l}]}],{l,0,n}],{t,2,n-1}]
Sum[f[x,z,n-1],{x,1,2^n},{z,1,n+1}]
Out[]=
281571
![](/img/download-icon.png)
![](/img/Open-In-Cloud-icon.png)
Cite this as: Tricia Brown, "Nonattacking Arrangements of Kings on Even Length Chessboard" from the Notebook Archive (2022), https://notebookarchive.org/2022-02-0zki6rn
![](/img/download-icon-white.png)
Download
![](/img/Open-In-Cloud-icon-white.png)
![](/img/3-Dots-white.png)