Skip to content

theahnaseri/magic-square

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 

Repository files navigation

magic-square

A magic square puzzle of the order n is an organization of n^2 numbers in a square. The n numbers in all rows, columns, and diagonals add up to the same constant. Rules Arrange the numbers from smallest to largest. Place the smallest number in the middle square on the top row. Put succeeding numbers on a diagonal (going to the right and up). When you run out of rows (fall off the top), go to the bottom of the column in which you want to place the number. When you run out of columns (fall off to the right), go to the extreme left of the row in which you want to place the number. If the space in which you want to place the number is occupied, put the number in the space below the last occupied space. When you fall out the main diagonal, put the number in the space below the last occupied space (which should be in the second row on the extreme right). If you are using consecutive numbers beginning with 1, you can find the magic number by the formula, (n(n^2 + 1) / 2, where n is the number of rows.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages