Skip to content

Magic square

In mathematics, especially historical and recreational mathematics, a magic square is a square array of numbers, usually positive integers, where the sums of the numbers in each row, each column, and both main diagonals are the same.

Version
v2 · 2026-11-14 · History
Domain-specific #
10523
Domain group
Formal Sciences
Origin domain
Mathematics
Subdomains
Recreational Mathematics, Combinatorics → Mathematics

Core Idea

Magic square is treated here as the recurring mathematics, logic, and statistics identity summarized by this source-grounded definition: In mathematics, especially historical and recreational mathematics, a magic square is a square array of numbers, usually positive integers, where the sums of the numbers in each row, each column, and both main diagonals are the same. In mathematics, especially historical and recreational mathematics, a magic square is a square array of numbers, usually positive integers, where the sums of the numbers in each row, each column, and both main diagonals are the same.

How would you explain it like I'm…

Same-Total Number Grid

A magic square is a square grid filled with numbers. If you add up the numbers in any row, any column, or either corner-to-corner line, you always get the same total. It's like a number puzzle where every line balances.

Every Line Adds the Same

A Magic square is a square grid of numbers where each row, each column and both main diagonals add up to the same total, called the magic sum. The number of squares along one side is called its order. A 'normal' magic square uses each of the numbers 1, 2, 3 and so on up to the number of boxes exactly once, like a 3-by-3 grid using 1 through 9. Squares that repeat numbers are called trivial and do not count under the usual definition.

Equal-Sum Square Array

A magic square is a square array of numbers, usually positive integers, in which the sums of each row, each column, and both main diagonals are all equal. Its order n is the number of entries along one side, and the common sum is called the magic constant or magic sum. A magic square is normal if it contains exactly the integers 1, 2, …, n², and many authors use 'magic square' to mean the normal kind. Arrays with repeated entries are called trivial and don't fit that definition; the Sagrada Família magic square is a well-known trivial example. Magic squares belong mainly to historical and recreational mathematics.

 

In historical and recreational mathematics, a Magic square is an n-by-n array of numbers, usually positive integers, whose row sums, column sums and two main diagonal sums are all equal. The integer n is the order, and the common sum is the magic constant or magic sum. A normal magic square contains exactly the integers 1, 2, ..., n^2, and many authors use 'magic square' to mean the normal case. Squares containing repeated entries do not meet this definition and are termed trivial; the Sagrada Família magic square is a well-known trivial example. The defining test is equal sums along all rows, columns and both main diagonals; a grid sharing only the name or a surface resemblance does not qualify.

Scope of Application

  • History. Around this time, some of these squares were increasingly used in conjunction with magic letters, as in Shams Al-ma'arif, for occult purposes.

  • Europe after 15th century. In an attempt to explain its working, de la Loubere used the primary numbers and root numbers, and rediscovered the method of adding two preliminary squares.

  • History. By the end of the 12th century, the general methods for constructing magic squares were well established.

  • China. This is the earliest appearance of a magic square on record; and it was mainly used for divination and astrology.

  • China. The oldest surviving Chinese treatise that displays magic squares of order larger than 3 is Yang Hui's Xugu zheqi suanfa (Continuation of Ancient Mathematical Methods for Elucidating the Strange) written in.

Clarity

A clear use of Magic square names the carrier, the operative relation, and the conditions under which the source treats the identity as present. The minimal definition is In mathematics, especially historical and recreational mathematics, a magic square is a square array of numbers, usually positive integers, where the sums of the numbers in each row, each column, and both main diagonals are the same.

Manages Complexity

Magic square compresses multiple mathematics, logic, and statistics details into a stable diagnostic relation. The source shows both the central mechanism—in the example below, a 4×4 associative magic square on the left is transformed into a square on the right by interchanging the second and third row, yielding the famous Durer's magic square.—and the practical consequence—given any magic square, another magic square of the same order.

Abstract Reasoning

  1. Type the carrier. Identify the mathematics, logic, and statistics entities to which the claim applies.
  2. State the relation. Use the source-grounded identity: In mathematics, especially historical and recreational mathematics, a magic square is a square array of numbers, usually positive integers, where the sums of the numbers in each row, each column, and both main diagonals are the same.
  3. Check operation and conditions.

Knowledge Transfer

Within the home domain. Knowledge about Magic square transfers literally when a new case preserves the same carrier type, relation, and recognition test. Around this time, some of these squares were increasingly used in conjunction with magic letters, as in Shams Al-ma'arif, for occult purposes. In an attempt to explain its working, de la Loubere used the primary numbers and root numbers, and rediscovered the method of adding two preliminary squares. Beyond the home domain. No canonical parent is asserted for Magic square.

Relationships to Other Abstractions

Local relationship map for Magic squareParents appear above the current abstraction, mutual partners to the right, and children below. Node labels state whether each abstraction is prime or domain-specific; colors identify relation types.Magic squareDOMAINDomain-specific abstraction: Matrix — is a kind ofMatrixDOMAIN

Current abstraction Magic square Domain-specific

Parents (1) — outgoing typed relations

  • Magic square is a kind of Matrix Domain-specific

    A magic square is a square numeric matrix with equal row, column, and main-diagonal sums.

Hierarchy paths (5) — routes to 5 parentless roots

Neighborhood in Abstraction Space

Magic square sits in a sparse region of the domain-specific corpus (83rd percentile for distinctiveness): few abstractions share its structure, so a faithful description tends to retrieve it precisely.

Family — Geometric Figures & Constructions (32 abstractions)

Nearest neighbors

Computed from structural-signature embeddings · 2026-11-14