Nepedia
Back to Discover
Advanced Reader
🔢

Magic square

math Maturity 7-9 supernatural Next article →

This article covers sensitive topics: supernatural. Parents can manage visibility in Parental Controls.

A magic square is a specialized square array of numbers.

Magicsquareexample
Magicsquareexample

Most often, these arrays use positive integers. A square is considered magic if the sum of every row, every column, and both main diagonals is identical. This shared sum is known as the magic constant. The size of the square is defined by its order, which is the number of integers along one side.

Yuan dynasty iron magic square
Yuan dynasty iron magic square

If a square uses the set of consecutive positive integers without any repeats, it is called a normal magic square. If the rows and columns reach the magic constant but the diagonals do not, it is called a semimagic square.

Euler knight tour semimagic square
Euler knight tour semimagic square

Mathematicians study magic squares through construction, classification, and enumeration. Construction refers to the methods used to build these grids. While no single method works for every possible magic square, three general techniques are known. One technique is called bordering, where a square is built by adding layers around a central core. Another method involves making composite magic squares, which are built from smaller magic squares. A third technique involves adding two preliminary squares together to create a new one.

4x4 magic square hierarchy
4x4 magic square hierarchy

Other specific strategies, such as continuous enumeration, can reproduce very specific patterns.

Magic squares are classified into different types based on their order, or the number of cells on a side. They are categorized as odd if the order is an odd number. If the order is a multiple of 4, the square is called doubly even, or evenly even. If the order is even but not a multiple of 4, it is called singly even, or oddly even. This classification is vital because different construction techniques are required for each type. Beyond this, squares can be classified by further properties. These include associative magic squares, pandiagonal magic squares, and most-perfect magic squares.

Geomagic square - Diamonds
Geomagic square - Diamonds

The history of magic squares spans thousands of years. The earliest recorded instances date back to at least 190 BCE in China.

Magic square Lo Shu
Magic square Lo Shu

In the 1st century CE, a Chinese book called Da Dai Liji described the 3x3 square. This square was also mentioned in a mathematical text called Shushu jiyi. By the 12th century, Chinese mathematicians identified the 3x3 square as the Luoshu square. In 1275, the scholar Yang Hui published a treatise containing many squares. He provided squares of order 3, two versions for each order from 4 to 8, an order 9 square, and a semimagic square of order 10.

Suanfatongzong-790-790
Suanfatongzong-790-790

Other cultures developed unique uses for these mathematical patterns. In India, the 3x3 magic square appeared in the text Gargasamhita to pacify the nine planets. A medical text by Vrnda also used the 3x3 square to assist women in labor. Around 587 CE, the Indian scholar Varahamihira used a 4x4 magic square in the Brhat Samhita. This square was used to determine the proportions of four substances for making perfumes.

Hindi Manuscript 317, folio 2b Wellcome L0024035
Hindi Manuscript 317, folio 2b Wellcome L0024035

In the Middle East, magic squares were used for occult purposes. The famous Arabic book Shams Al-ma'arif, written by Ahmed bin Ali Al-boni, featured magic letters and squares. These squares eventually reached Europe through the translation of Arabic texts during the Renaissance.

Japan also developed a deep mathematical tradition involving magic squares. This interest grew in the 17th century following the spread of Chinese works. In 1683, Seki Takakazu published Hojin Yensan, a book entirely devoted to magic squares and circles. This was the first Japanese text to provide a general treatment of the subject. It clearly described algorithms for constructing odd, singly even, and doubly even bordered squares. By the start of the 18th century, Japanese mathematicians could construct squares of almost any order. Some scholars even attempted to enumerate them, such as Nushizumi Yamaji.

Magic squares have also left a lasting mark on the world of art. The artist Albrecht Dürer included an order 4 magic square in his 1514 engraving, Melencolia I.

Albrecht Dürer - Melencolia I (detail)
Albrecht Dürer - Melencolia I (detail)

This specific square has a magic constant of 34. Another example appears in the painting Bélial, Emperor of the Flies, by Wifredo Lam. In modern mathematics, the concept has been generalized even further. Researchers now explore magic squares using multiplication instead of addition. They also study them in different dimensions, using shapes instead of numbers or different geometric operations.

696 words

Where will your curiosity go next?

Keep exploring at your chosen reading level.

🖼️ Images & Media (19)
File:Magicsquareexample.svg
Magicsquareexample.svg
File:Dürer Melancholia I.jpg
Dürer Melancholia I.jpg
File:Albrecht Dürer - Melencolia I (detail).jpg
Albrecht Dürer - Melencolia I (detail).jpg
File:Yuan dynasty iron magic square.jpg
Yuan dynasty iron magic square.jpg
File:Suanfatongzong-790-790.jpg
Suanfatongzong-790-790.jpg
File:Hindi Manuscript 317, folio 2b Wellcome L0024035.jpg
Hindi Manuscript 317, folio 2b Wellcome...
File:16th century arabic magic square.jpg
16th century arabic magic square.jpg
File:Sigillum Iovis.jpg
Sigillum Iovis.jpg
File:Siamese Square.jpg
Siamese Square.jpg
File:Magic square Lo Shu.png
Magic square Lo Shu.png
File:Magic square at the Parshvanatha temple, Khajuraho.png
Magic square at the Parshvanatha temple,...
File:Barcelona Sagrada Familia passion facade magic square.jpg
Barcelona Sagrada Familia passion facade...

+ 7 more

More to explore

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.