䷀䷁ ䷂䷃ ䷄䷅ ䷆䷇ ䷈䷉ ䷊䷋ ䷌䷍ ䷎䷏ ䷐䷑ ䷒䷓ ䷔䷕ ䷖䷗ ䷘䷙ ䷚䷛ ䷜䷝ ䷞䷟ ䷠䷡ ䷢䷣ ䷤䷥ ䷦䷧ ䷨䷩ ䷪䷫ ䷬䷭ ䷮䷯ ䷰䷱ ䷲䷳ ䷴䷵ ䷶䷷ ䷸䷹ ䷺䷻ ䷼䷽ ䷾䷿
The question: the King Wen sequence — the ~3,000-year-old received ordering of the 64 I Ching hexagrams — has attracted structural claims for centuries, almost all asserted by inspection. Can those claims be tested? Can the sequence be reconstructed from its mathematical constraints? This project treats the sequence as a combinatorial object: it enumerates the space of orderings satisfying the sequence's constraints, measures claimed regularities against that space, and proves (with machine-checked proofs and SAT certificates) what is forced, what is rare, and what is impossible.
New to the I Ching or combinatorics? Start with GUIDE.md.
The sequence's structural properties, extracted from the received order and its classical commentary, are treated as axioms defining a space of orderings (formal definitions · plain-language summary):
- C1 — the 64 hexagrams form 32 consecutive pairs, each a hexagram with its reverse (or complement when reversal is trivial): the classical pairing, described by Yu Fan in the 3rd century.
- C2 — no two adjacent hexagrams differ in exactly five lines (McKenna & McKenna 1975).
- C3 — complementary hexagrams sit near each other (a positional-distance ceiling at KW's own value).
- C4 — the sequence starts with the pair ䷀ Qian (The Creative) #1 and ䷁ Kun (The Receptive) #2, i.e., Heaven followed by Earth.
- C5 — the multiset of adjacent-transition sizes matches King Wen's exactly.
C1–C2 are robust properties; C3–C5 are extracted from the sequence itself — the distinction matters and is policed throughout (CRITIQUE.md). Two further extracted constraints (C6–C7) appear only where marked.
| Tool | Role |
|---|---|
| solve.c | The enumerator. Multi-threaded C; produces byte-reproducible enumeration slices anchored by sha256 (CANONICAL_HASHES); also an unbiased estimator of the full space. Deepest artifact: 10.5 billion orderings, derived twice byte-identically on preemptible cloud. |
| solve.py | The independent ground truth. Every constraint implemented a second time, in Python, and cross-checked against the C. |
| sat.py | The decision layer. Encodes exact questions ("does an ordering with property X exist?") for a SAT solver; UNSAT answers carry independently checkable certificates. |
| roae.py | The exploratory analysis suite: 28 statistical analyses of the sequence with honest null models (example output). |
| lean/ | Machine-checked theorems (Lean 4): the core lemmas, four sequence-level theorems, the trigram-level structure (TRIGRAM_STRUCTURE), and the model-level merge/partition-invariance theorems (see lean/README.md for the trust-base and scope notes). |
| tests.py · verify.py · verify_all.sh | The verification layer — the instrument that checks the other five: Python regression harness, two-language record verifier, and the one-command check of every certificate, gate, and proof. |
Headlines only — each links to its full treatment (technical reports in reports/):
- The constraints do not determine the sequence. The C1–C5 space holds 1.33×10³⁸ orderings; adding C6–C7 still leaves ~5×10³¹. The hypothesis that the constraints pin down King Wen — the strong reading of the literature's derivation claims, and this project's own early working assumption (attribution note) — is false. TR-4
- The literature's rules conflict. The four strongest rules asserted across eight centuries are jointly unsatisfiable for any ordering preserving the classical pairing — none can be perfect under all of them. King Wen keeps one exactly and misses the others minimally: its famous anomalies are a forced trade-off, not damage — and a 47-year-old proposal to replace the sequence is decided along the way. TR-1, TR-2, TR-8
- Eight rules asserted as design behave as empirically forced — population mass 1.0 to the estimator's precision (no violating ordering in 2×10¹⁰ weighted probes; one, the no-5 rule's implication chain, additionally proven analytically — the others are zero-hit sampling results, not theorems). To that precision they are consequences of the constraint system, not choices. Others are genuinely discriminating (to ~1 in 5×10⁷ — an order-of-magnitude figure at that sampling depth; see METHODS). TR-1
- Every valid ordering has exactly 23 indistinguishable twins (the symmetry group acts freely), and exactly 15 parity-class alternations (proven three independent ways). TR-5, TR-6
- McKenna's "ninth six" is forced. The 1975 observation that exactly one adjacent transition flips all six lines holds in every valid ordering — machine-proven: the between-pair transition budget is a theorem of the constraints, turning the 10.5-billion-record measurement into a corollary (the position of that transition remains ordering-dependent). TRIGRAM_STRUCTURE
- The pairing is optimal — the classical pair structure is the unique Hamming-cost-minimizing matching (Radisic 2026 — preprint, machine-verified). CITATIONS
- The circular reading has a price. Read as a cycle (McKenna's construction), the sequence needs one more rule — and orderings violating it are 17.4% of the full space yet absent from all 10.5 billion enumerated records: the sharpest demonstration that bounded search sees a biased sample. TR-7
- Half the sequence is explained; half by nothing known. In bits: the classical pairing carries nearly all the explanatory weight (and is provably optimal); the transition histogram is confirmed description, not explanation; ~126 bits remain open. TR-9
- A structural reading, measured. Davis's (2012) flagship compositional units come out population-typical; one uniqueness claim is corrected; the ~126-bit residual survives its second literature-guided attack. TR-10
- The record is reproducible: every published count re-derivable to the byte by one command; the deepest run reproduced from scratch through seven fresh Spot evictions (twelve across both runs). TR-3
Honesty apparatus. Every caveat lives in CRITIQUE.md — read it before quoting anything above. It covers the constraint-extraction circularity, the null-model studies, the look-elsewhere accounting, and one corrected published result. It also reports the corpus-control test: the same methodology flags a provably algorithmic ordering (Jing Fang) on 9 of 11 axes, and King Wen on exactly its three documented constraints — the method does not find design wherever it looks (a control corpus of the two documented historical alternatives available; the small n is stated in CRITIQUE).
gcc -O2 -pthread -fopenmp -o solve solve.c -lm -lz && ./solve --selftest # must print PASS
python3 roae.py # the 28 analyses
python3 solve.py --registry-verify # the two-language ground-truth gates (31/31 must PASS)
python3 sat.py # SAT layer usage + targets
python3 tests.py # regression harness (28 tests)
bash reports/certificates/verify_all.sh # everything above + all DRAT certs + Lean, one command
Full CLI references: SOLVE_C_CLI · ROAE_PY_CLI.
If you read one thing: TR-1 — the literature's rules, measured and decided. reports/ — the full technical report suite (start at its index for the map and reading paths) · PROJECT_OVERVIEW — the detailed findings narrative formerly on this page · CLAIMS_DECIDED — the empirical scorecard (what's refuted, corrected, forced, confirmed) · SOLVE_SUMMARY — plain-language results · CITATIONS — every source, every attribution, annotated bibliography · HISTORY — the project narrative including its mistakes.
All scholarly attribution lives in CITATIONS.md and is deliberately not duplicated here — classical sources (Yu Fan, Zhu Yuansheng, Lai Zhide), the modern structural literature (Schulz, Moore, Cook, Hacker, McKenna & Mair, Davis, Drasny), the 2026 arXiv treatments (Chan; Radisic), methodological citations, and per-finding scoping of what is classical / prior work / independently verified / believed novel. CITATIONS.md includes a standing invitation to report prior work not yet cited.
The links below are reader orientation only:
- King Wen sequence — Wikipedia
- King Wen of Zhou — Wikipedia (traditional attribution, ~1000 BCE; modern scholarship is divided on the exact origin and dating of the sequence)
- OEIS A102241 — binary encoding of King Wen hexagrams
- Bagua (eight trigrams) — Wikipedia (trigram names and associations)
- Hexagram (I Ching) — Wikipedia (hexagram structure, nuclear trigrams)
- I Ching divination — Wikipedia (three-coin method, simulated by
roae.py --cast) - Shao Yong — Wikipedia (Fu Xi binary ordering)
- Mawangdui Silk Texts — Wikipedia (background on the silk manuscripts; the ordering itself is per Shaughnessy 2022 below, tested by
solve.c --null-historical) - Jing Fang — Wikipedia (Eight Palaces ordering, also tested by
solve.c --null-historical) - The I Ching or Book of Changes — Richard Wilhelm, trans. Cary F. Baynes, Princeton University Press (hexagram names)
- Edward L. Shaughnessy, I Ching: The Classic of Changes, Ballantine Books, 1996 (translation of the Mawangdui manuscript); the project's Mawangdui ordering array follows Shaughnessy, The Origin and Early Development of the Zhou Changes, Brill, 2022, Table 11.2 (corrected 2026-07-05 — see CITATIONS.md errata)
- Yijing Dao (biroco.com) — Steve Moore's archive of Yijing structural-analysis literature (source of several documents examined in CITATIONS.md)
- Terence McKenna: Novelty theory and Timewave Zero — Wikipedia (see MCKENNA.md; full citation in CITATIONS.md)
Claude Code (Anthropic) — see AI-assistance headers in each source file.