MAGIC SQUARE

Photo by Riho Kroll on Unsplash
How to Play?

A magic square of size nxn is an arrangement of numbers from 1 to n2 such that the sum of the numbers in each row, column and diagonal is the same. Each cell in a nxn grid has a different number and the numbers range from 1 to n2. Sum required for each grid is shown on top of the grid.


Example
3x3
32 is 9. Arrange the numbers 1 to 9 in a 3x3 grid such that:

  • Each cell in a grid has a different number
  • Sum of all the 3 rows is 15
  • Sum of all the 3 columns is 15
  • Sum of both the diagonals is 15
Example of 3x3 grid