文王序卦

The King Wen Sequence

The traditional ordering of the 64 hexagrams, attributed to King Wen of Zhou (周文王), circa 1050 BC. This arrangement encodes a cosmological and philosophical progression through paired opposites — a structure that has shaped Chinese thought for three millennia.

By Augustin Chan with AI · Published January 2025 · Updated March 2026

What Is the King Wen Sequence?

The King Wen sequence (文王序卦) is the traditional ordering of the 64 hexagrams of the I-Ching, attributed to King Wen of Zhou (周文王) circa 1050 BC. It arranges the hexagrams into 32 paired opposites — 28 inverse pairs formed by flipping a hexagram upside down, and 4 complement pairs where every line is inverted. Our analysis of this 3,000-year-old sequence reveals a sophisticated mathematical structure: the pairs follow a cosmological progression from creation (hexagrams 1–2, Heaven and Earth) through the full arc of human experience to the perpetual state of incompletion (hexagrams 63–64, After Completion and Before Completion).

Unlike a random or purely mathematical ordering, the King Wen sequence embeds strategic logic. Each transition between hexagrams encodes a shift in conditions — from abundance to decline, from conflict to resolution — that mirrors the decision-making patterns observed in statecraft and warfare. Our planned Warring States simulation will test whether this ancient pattern recognition can guide an AI agent through complex multi-agent strategy, competing against modern machine learning.

The Lo Shu Magic Square & Chinese Mathematical Cosmology

Chinese cosmological tradition associates the King Wen sequence with a broader system of mathematical diagrams believed to encode the structure of the universe. The Lo Shu (洛書, “Luo River Writing”) is a 3×3 magic square in which every row, column, and diagonal sums to 15. According to legend, the diagram appeared on the shell of a turtle emerging from the Luo River, and was received by the Great Yu (大禹) as a template for ordering the world.

The Lo Shu is traditionally linked to the Later Heaven arrangement of the eight trigrams (後天八卦), attributed to King Wen himself. In this arrangement, each trigram occupies a cardinal or intercardinal direction, and the magic square's number pattern determines their positions. The companion diagram, the He Tu (河圖, “Yellow River Map”), is associated with the Earlier Heaven trigram arrangement (先天八卦) attributed to the legendary Fu Xi.

Together, the Lo Shu, He Tu, and King Wen sequence form the cosmological framework within which the I-Ching operates. Whether these structures encode genuine mathematical relationships or represent a coherent symbolic system developed over centuries of observation remains an active area of scholarly inquiry — and is precisely the question our planned experiment seeks to explore through empirical testing.

Classical Context

The Xugua zhuan 序卦傳 (Sequence of Hexagrams commentary) is one of the Ten Wings (十翼), the canonical commentaries traditionally attributed to Confucius. It provides the philosophical rationale for the ordering of the hexagrams.

Each hexagram follows from the previous through a logic of cosmological and human development. Heaven and Earth give rise to all things; difficulty follows creation; from youthful folly comes the need for patience — and so the sequence unfolds, tracing the arc of existence from genesis to the perpetual state of incompletion.

Structural Overview

64

Hexagrams

All possible six-line figures

32

Paired Opposites

Every hexagram has a partner

28

Inverse Pairs 反覆

Flipped upside down (fanfu)

4

Complement Pairs 旁歸

All lines inverted (pangui)

Of the 32 pairs, 28 are formed by inversion — flipping a hexagram upside down yields its partner. Four hexagrams are vertically symmetric (they look the same upside down), so their pairs are formed by complementation — flipping every line from solid to broken and vice versa. These special pairs are hexagrams 1/2, 27/28, 29/30, and 61/62.

The Sequence Visualized

All 32 pairs in King Wen order. Each pair shows both hexagrams with their structural relationship.

Sources & Further Reading

  1. 序卦傳 (Xugua zhuan, “Sequence of Hexagrams Commentary”). One of the Ten Wings (十翼), traditionally attributed to Confucius (551–479 BC). The canonical explanation for the King Wen ordering of the 64 hexagrams.
  2. Wilhelm, Richard, trans. The I-Ching, or Book of Changes. Rendered into English by Cary F. Baynes. 3rd ed., Princeton University Press, 1967. The standard scholarly English translation, including the Ten Wings commentary.
  3. 王弼 (Wang Bi, 226–249 AD). 周易注 (Zhouyi zhu). The foundational commentary on the I-Ching that established the “Images and Numbers” school of interpretation.
  4. 孔穎達 (Kong Yingda, 574–648 AD). 周易正義 (Zhouyi zhengyi). Tang dynasty subcommentary on Wang Bi, part of the 十三經注疏 (Thirteen Classics with Commentaries and Subcommentaries).
  5. Shaughnessy, Edward L. Unearthing the Changes: Recently Discovered Manuscripts of the Yi Jing. Columbia University Press, 2014. Archaeological evidence from Mawangdui and Shanghai Museum manuscripts illuminating the sequence's history.
  6. 韓仲民 (Han Zhongmin). 帛書周易卦序研究” (“Research on the Silk Manuscript Zhouyi Hexagram Sequence”). Comparative analysis of the Mawangdui sequence against King Wen ordering.
  7. Chan, Augustin. King Wen Sequence as Learning Optimization: Testing Ancient Algorithms Against Modern ML. Zenodo, 2025. [PDF]