# Magic Square

**Type:** Concept  
**Domain:** Recreational Mathematics  
**Codex URL:** /mathematics/recreational/magic-square/  
**Entry status:** Live — v1.0 (2026-05-27)

## Summary
A grid of numbers where every row, column, and diagonal sums to the same total. Known across Chinese, Indian, Islamic, European cultures for 2000+ years.

## Magic constant
M = n(n²+1)/2 for n×n square using numbers 1 to n². For n=3: M=15 (Lo Shu square). For n=4: M=34 (Dürer's square).

## The Lo Shu square (China, legendary, 2000+ years old)
4 9 2 / 3 5 7 / 8 1 6 — every row, column, diagonal = 15

## Dürer's 1514 square
Encodes the year 1514 in its bottom row; also has additional "magic" properties beyond the basic requirements.

## Construction
Siamese method (odd n) — de la Loubère, 1693, from Siamese/Thai tradition.

## Ramanujan's magic squares
Constructed squares encoding specific dates (e.g. his birth date) in the top row.

## Latin squares connection
Related structure used by Fisher (1920s-30s) in statistical experimental design.

## Sources
### Tier 1
- Andrews, W.S. (1917/1960). *Magic Squares and Cubes*. Dover.
### Tier 2
- Pickover, C.A. (2002). *The Zen of Magic Squares*.
- Cammann, S. (1960). Evolution of magic squares in China. *JAOS*.

---
*Mathematics Codex entry v1.0 — added 2026-05-27 — thecodex.expert/mathematics/*
