China is considered the birthplace of magic squares, since it is in this country that Feng Shui teachings exist, according to which everything is important for influencing the Qi flow: color, shape, and the location of each individual element in space.
History of the development of magic numbers
A magic square is a table of magnitude n by n, which is filled with natural numbers from 1 to n2. In this case, the sums for all columns, rows, and on the diagonals must match. There are magic squares with even and odd order. The numbers that are written in the fields of the table are called magic square cells, and the total value of the numbers that appear in any column, row or diagonal is its constant. Sacred, magical, mysterious, perfect magic square. The answer attracts him with apparent simplicity.
Divine turtle
The magic square of Luo Shu was sent to Emperor Yu by the gods to learn the secrets of the world. According to legend, about four thousand years ago, a large Shu turtle emerged from the waters of the turbulent river Lo, which was immediately recognized by people as a deity. And this turtle was in fact unusual, since an unusual dot pattern was applied to its shell. The points were drawn in such a way that the ancient philosophers came to the conclusion that the square with the dots on the shell is a map of the world, which was compiled by the mythical founder of the Huang Di civilization in China. If you add the sum of the numbers in each column, row, and on both diagonals of the square, you get the number 15, which is equal to the number of days in the 24 cycles of the Chinese solar year.
Emperor Yu decided that the considerations of the ancient sages were not far from the truth, and ordered that the image of the turtle be immortalized on paper and sealed with his imperial seal.
Durer's Magic Square
Albrecht Dürer, a famous German artist, immortalized this amazing representative of the imaginary world of numbers in art on the engraving "Melancholy". The Dürer square consists of 16 first true numbers and has a size of 4 by 4. In each column, row and diagonal, the sum of the numbers is 34. The sums of the other four numbers located in the corner cells in the center and sides of the central square are also 34. But the numbers 15 and 14 in the bottom line of the square mean the date of the engraving - 1514.
The magic square of Khajuraho
In 1838, a young British officer found among the images of goddesses and gods on the temples of Viswanatha a fourth-order square that was amazing. The sums on the rows, columns, and on the diagonals of this square were the same and equal 34. They coincided also on the broken diagonals that formed when the square was turned into a torus, and in each of two directions. For such a magical total value of the numbers, the squares are also called devilish.

From any magic square, it is possible by rearrangements of its constituent numbers to obtain a huge number of new magic squares that will have the same properties. As you know, there are no 2 by 2 squares. And 3 by 3 - there is only one. Squares 4 by 4, as in the engraving by Dürer, have already been compiled about 800, and 5 by 5 already almost 250 thousand. There is a belief that a magic square engraved on silver protects from the plague. And today you can see them among the attributes of soothsayers in Europe who attribute various mystical properties to them.