Nepedia
Back to Discover
Fluent Reader
🔢

Magic square

math Maturity 7-9 supernatural Next article →

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

Imagine a square grid filled with numbers.

Magicsquareexample
Magicsquareexample

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.

Yuan dynasty iron magic square
Yuan dynasty iron magic square

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.

4x4 magic square hierarchy
4x4 magic square hierarchy

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.

Magic square Lo Shu
Magic square Lo Shu

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.

Suanfatongzong-790-790
Suanfatongzong-790-790

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.

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

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.

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

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.

469 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.