We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
It helps to know (from wiki [1] and YouTube video [2]) there are 8 possible 3x3 magic squares. Each can be obtained by a rotation or reflection (or combination of) of each other.
If you define a starting magic square, you can perform the following relatively simple transormations to obtain all 8 squares:
M# Starting squarerotate(M)# rotate clockwise 90 degreesrotate(rotate(M))# rotate clockwise 180 degreesrotate(rotate(rotate(M)))# rotate clockwise 270 degreesrefect(M,dim=rows)# reflect along row dimensionreflect(M,dim=cols)# reflect along column dimensionreflect(M,dim=diag)# reflection along main diagonaltranspose(M)# reflect along off-diagonal
You have to define these functions, but atleast they're quite simple and you don't have to search all possible permutations.
A useful YouTube video is 'SOLVE The 3x3 Magic Square Completely - There Can Only Be One!'
Forming a Magic Square
You are viewing a single comment's thread. Return to all comments →
It helps to know (from wiki [1] and YouTube video [2]) there are 8 possible 3x3 magic squares. Each can be obtained by a rotation or reflection (or combination of) of each other.
If you define a starting magic square, you can perform the following relatively simple transormations to obtain all 8 squares:
You have to define these functions, but atleast they're quite simple and you don't have to search all possible permutations.
A useful YouTube video is 'SOLVE The 3x3 Magic Square Completely - There Can Only Be One!'
[1] https://en.wikipedia.org/wiki/Magic_square
[2] https://www.youtube.com/watch?v=zPnN046OM34