Imagine a box of numbers. 
Imagine a box of numbers. 
People have used these for a very long time. Some were found in China a long time ago. In India, people used them to make perfumes. 
Imagine a grid filled with numbers. 
People have loved these number puzzles for a long time. The oldest records come from China around 190 BCE. 


Imagine a square grid filled with numbers. 
Building these squares can be a very hard job. There is no single way to make every kind of magic square. However, people have discovered three main techniques over time. One way is called bordering, where you build around the outside. Another way is making composite magic squares from smaller ones. A third way involves adding two preliminary squares together.
People have been fascinated by these patterns for thousands of years. The earliest records come from China around 190 BCE. 

Other cultures also found special uses for these number grids. In India, a 3x3 square appeared in a text by Vrnda. This book was used to help women during labor. Another Indian text from around 587 CE used a 4x4 square to help make perfumes. 
Magic squares have even appeared in famous works of art. The artist Albrecht Dürer included an order 4 square in his 1514 painting, Melencolia I. 
A magic square is a specialized square array of numbers. 
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.
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. 
The history of magic squares spans thousands of years. The earliest recorded instances date back to at least 190 BCE in China. 

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. 
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. 
🖼️ Images & Media (19)
+ 7 more
More to explore
✨ What else?
Related topics you might enjoy
🔬 Go deeper
More advanced topics to explore
🪜 Step back
Simpler topics to build understanding
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.