Imagine a box of numbers.
All the rows add up to the same sum. All the columns do too. Even the lines from corner to corner match!
People have loved these for a long time. It is like a fun puzzle. Can you find the pattern?
Imagine a box of numbers.
In a magic square, the numbers follow a rule. If you add up each row, they match. Each column adds up to that same number, too. Even the lines from corner to corner work!
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.
Artists even put them in beautiful paintings. These number puzzles are still fun to study today.
Imagine a grid filled with numbers.
In a magic square, these numbers follow a special rule. If you add up the numbers in any row, they reach a set total. The columns must reach that same total. Even the lines from corner to corner must match. This total is called the magic constant.
People have loved these number puzzles for a long time. The oldest records come from China around 190 BCE.
In India, people used magic squares for many things. One old book used them to help make perfumes. Another text used them to help women in labor.
Artists also used them in art. The artist Albrecht Dürer put one in a famous painting.
Today, math experts still study how to make them. They look at how many different squares can exist. Finding all the squares for large grids is still a hard puzzle.
Imagine a square grid filled with numbers.
In a magic square, these numbers follow a very strict rule. If you add up the numbers in any row, they reach a specific total. The columns must also reach that same total. Even the two main diagonal lines from corner to corner must match. This special total is called the magic constant.
A square is called "normal" if it uses only positive integers without repeating any. If some rows or columns match the total but the diagonals do not, it is a semimagic square. Mathematicians study how to build these grids and how many different versions can exist.
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.
Experts also group squares by their size, or "order." They look at whether the number of cells on a side is odd, doubly even, or singly even. This helps them know which building method to use.
People have been fascinated by these patterns for thousands of years. The earliest records come from China around 190 BCE.
In ancient China, a 3x3 square was known as the "Nine Halls." By the 12th century, people called it the Luoshu square. In 1275, a writer named Yang Hui shared many different squares. He showed squares of order 3 all the way up to order 9.
He even showed a semi-magic square with 10 cells on each side. These patterns were often used for things like astrology or divination.
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.
In Japan, mathematicians studied these squares deeply during the 17th century. A man named Seki Takakazu wrote a whole book about them in 1683. He described clear ways to build many different types of squares. By the early 1700s, Japanese scholars could build squares of almost any size.
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.
This specific square has a magic constant of 34. You can also find them in the work of Wifredo Lam. Even today, math is changing how we see these squares. Some people use multiplication instead of addition. Others use shapes instead of numbers to create new patterns. The study of these grids remains a wonderful part of math history.
A magic square is a specialized square array of numbers.
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.
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.
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.
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.
The history of magic squares spans thousands of years. The earliest recorded instances date back to at least 190 BCE in China.
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.
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.
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.
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.
🖼️ 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.