In 1514, Albrecht Dürer slipped his own initials and the year into a 4×4 grid of numbers, and the trick relies on a puzzle that China had been drawing for well over a thousand years.
The grid where every line adds up to 34
The grid appears in Dürer’s engraving Melencolia I. Every row, every column and both diagonals add up to the same total: 34. That is the definition of a magic square.
But Dürer’s version goes further. The same 34 shows up in each of the four quadrants, in the four center cells and in the four corners.
Then comes the signature. The two middle numbers of the bottom row are 15 and 14, which spell out 1514, the year of the engraving. The numbers on either side are 1 and 4, matching the letters A and D, Dürer’s initials.
Where does 34 come from? Add every number from 1 to 16 and you get 136. Split that evenly across four lines and each one must carry 34. The square was labeled as Jupiter’s, a talisman meant to drive away melancholy, and it is believed to be the first seen in European art.
The turtle legend is older than the square it describes
The most famous origin story is the Lo Shu. A great flood hit ancient China, and while King Yu tried to channel the water out to sea, a turtle emerged with a pattern of dots on its shell: a 3×3 grid where every line added up to 15.
The legend dates back as early as 650 BCE. The square itself tells a different story.
The earliest appearance of the 3×3 square on record is in a text said to date from 190 BCE, where it was used for divination and astrology. The link to the turtle legend was only made in the 12th century, more than a thousand years later.
One more oddity: there is essentially only one 3×3 magic square. Every other version is just the Lo Shu rotated or flipped. And around 1275, the Chinese mathematician Yang Hui drew a 4×4 square very similar to Dürer’s, about 250 years earlier.
A perfume recipe with no magic in it
Around 550 CE, the Indian scholar Varahamihira wrote down the oldest dateable 4×4 magic square. Its purpose was surprisingly practical: mixing perfumes. Each cell stood for one of 16 ingredients, and any four chosen along a row, column or diagonal made a blend totaling 18 parts.
The text is mostly about divination, yet the square is presented as a combinatorial design, with no magical properties attached.
Centuries later, in 1356, the mathematician Narayana Pandit counted 384 of the special 4×4 squares that stay magic even when their edges wrap around. He also explained why anyone should bother: to build sacred diagrams, to humble bad mathematicians, and for the pleasure of the good ones.
From charm to parlor game
In the Islamic world, the 3×3 square turned up in the alchemy of Jābir ibn Hayyān, who lived from about 721 to 815. It was also used as a charm for women in labor. Yet the earliest surviving treatises, written around 987 and 998, were purely mathematical.
From the 13th century on, the occult took over. Squares were tied to the seven planets and reached Europe as mystical objects, with no instructions for building them. The theory had to be rediscovered from scratch.
By the 17th century, the numbers had replaced the magic. Bernard Frenicle de Bessy showed there are exactly 880 different 4×4 squares. Pierre Fermat boasted in a letter that he could build 1,004,144,995,344 of order 8. For 5×5, the count reaches 275,305,224. And there is no magic square of order 2 at all.
The church wall that got its sum wrong
The Passion façade of the Sagrada Família in Barcelona carries a 4×4 square with a magic constant of 33, the age of Jesus at the Passion. Sculptor Josep Subirachs built it by lowering four numbers of Dürer’s pattern by 1.
The result repeats numbers, which makes it a trivial magic square. Lee Sallows pointed out that this was a needless blunder, and showed several non-trivial 4×4 squares that reach 33 with no repeats.
The cultures that never found it
The Greeks, the Babylonians, the Egyptians and the pre-Columbian Americans all had strong mathematical traditions. None of them discovered the magic square.
A grid born from a turtle legend, a perfume recipe and a medieval amulet ended up on a Renaissance engraving and a Barcelona wall. Sometimes a number puzzle travels further than the people who first solved it.

