5D Library › Najia Hexagram Encoding and Qimen Dunjia Combinatorial Engines · 中文
Chapter 7. The Jing shi yizhuan and the Rhapsody of the Old Fisherman
Why read these sources here
The najia and the eight palaces are credited to Jing Fang of the Western Han; for the bureau numbers and the plates of Qimen, the Rhapsody of the Old Fisherman of the Misty Waves (Yanbo diaosou fu) is the usual summary verse. This chapter returns to both texts, checks the statements the models rest on, and marks where reading turns into interpretation.
The Jing shi yizhuan: eight palaces and najia
The received Jing shi yizhuan in three juan, traditionally ascribed to Jing Fang with a commentary by Lu Ji of Wu, arranges the sixty-four hexagrams by the eight palaces and discusses them by najia, world and response lines, and “flying and hidden” (Jing Fang (attributed) and Lu Ji (commentary), n.d.). The mask description of Chapter 1 turns its palace order into one sentence: pure hexagrams XOR eight fixed masks. The program also counts how the world line falls on the six lines.
Calculation
# Chapter 7. The numbers of the classics, recomputed.
# (1) The Rhapsody of the Old Fisherman (Yanbo diaosou fu) says Qimen
# once had 1,080 charts, cut to 72 and then to 18. We factor the three
# numbers in the terms of Chapter 3: bureaus, double-hours, solar terms
# and yuan.
# (2) Jing Fang's eight palaces (Chapter 1) put the world line on lines
# 6, 1, 2, 3, 4, 5, 4, 3 for the eight generations; we count how the 64
# hexagrams share the six lines.
SHI = (6, 1, 2, 3, 4, 5, 4, 3)
if __name__ == "__main__":
bureaus, hours, terms, yuan = 18, 60, 24, 3
print(" 1,080 = {} bureaus x {} double-hours of a bureau: {}".format(
bureaus, hours, bureaus * hours == 1080))
print(" 72 = {} solar terms x {} yuan: {}".format(
terms, yuan, terms * yuan == 72))
print(" 18 = 9 bureau numbers x 2 duns: {}".format(9 * 2 == 18))
print(" 72 term-yuan labels fall on 18 bureaus, {} labels each".format(
72 // 18))
print(" double-hours in a year of 72 five-day yuan: {:,d}".format(
72 * 60))
count = {line: 8 * SHI.count(line) for line in range(1, 7)}
print(" world line of the 64 hexagrams (line: hexagrams):")
print(" " + " ".join("{}: {}".format(k, v)
for k, v in count.items()))
print("\nReading: 1,080 counts bureau-hours, 72 counts term-yuan labels")
print("and 18 counts bureaus: three different units, not one list cut")
print("down twice. In the eight palaces the world line sits on line 3")
print("or 4 for half of all hexagrams.")
# 1,080 = 18 bureaus x 60 double-hours of a bureau: True
# 72 = 24 solar terms x 3 yuan: True
# 18 = 9 bureau numbers x 2 duns: True
# 72 term-yuan labels fall on 18 bureaus, 4 labels each
# double-hours in a year of 72 five-day yuan: 4,320
# world line of the 64 hexagrams (line: hexagrams):
# 1: 8 2: 8 3: 16 4: 16 5: 8 6: 8
#
# Reading: 1,080 counts bureau-hours, 72 counts term-yuan labels
# and 18 counts bureaus: three different units, not one list cut
# down twice. In the eight palaces the world line sits on line 3
# or 4 for half of all hexagrams.The world line of 16 hexagrams lies on line 3, of 16 on line 4, and of 8 on each of the other four lines: for half of all hexagrams it sits on the two middle lines. This follows directly from the eight masks (the third generation and the returning soul both put it on line 3, the fourth generation and the wandering soul on line 4). The text does not explain why the wandering and returning souls are arranged as they are; the program can only show that this arrangement gives the eight values of upper XOR lower all different, so that the generation can be read directly from the figure.
The Rhapsody of the Old Fisherman: 1,080, 72 and 18
Source text
Rhapsody of the Old Fisherman of the Misty Waves (received text)
一千八十當時制,太公刪成七十二。逮于漢代張子房,一十八局為精藝。
(One thousand and eighty was the system of that time; the Grand Duke cut it down to seventy-two. Then Zhang Zifang of the Han made eighteen bureaus the refined art.)
These lines are often read as saying that the bureaus of Qimen were cut from one thousand and eighty to seventy-two and then to eighteen. The program factors the three numbers in the units of Chapter 3: 1,080 is 18 bureaus times the 60 double-hours of a bureau; 72 is 24 solar terms times three yuan; 18 is nine bureau numbers times two duns. The three numbers use three different units: bureau-hours, term-yuan and bureaus. They are not one table cut down twice but three ways of counting one system; the 72 term-yuan fall on the 18 bureaus exactly four at a time (Chapter 3).
Hypothesis · not established
The author’s interpretation (not yet tested): “cut down” in the rhapsody can be read as the successive grouping of combinations counted by double-hour (1,080) into counts by term-yuan (72) and by bureau (18), rather than as evidence that three different Qimen systems existed in history. What would show this reading wrong: an early text recording a Qimen system that really worked with 1,080 independent rules that were not grouped in this way.
Note
Checking the texts. The lines of the rhapsody above are the received wording and have been checked against the standard printed edition, as has the first line quoted in Volume 62, “阴阳顺逆妙难穷,二至还乡一九宫”. The palace order and najia table of the Jing shi yizhuan follow the received text.
Summary
The palace order of the Jing shi yizhuan puts the world line on the two middle lines for half of all hexagrams and lets the generation be read directly from upper XOR lower. The 1,080, 72 and 18 of the Rhapsody are three units of counting in one system — bureau-hours, term-yuan and bureaus — not one table cut down twice.
References
Fan, Y. (2026). Najia Hexagram Encoding and Qimen Dunjia Combinatorial Engines: Eight-Palace Group Actions, Sexagenary Void Cosets, Split-Supplement versus Intercalation Divergences and Nine-Palace Rotor Permutations [纳甲装卦与奇门遁甲排盘的组合计算] (Version 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.24090182 · Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).