关于「儒略日与四柱的同余公式」,《四柱排盘的计算》给出的定量结论是什么?
结论:第一章用儒略日把日柱写成(儒略日 + 49)模 60 的余数,跨越 1582 年改历仍然连续,并把五虎遁、五鼠遁写成模 10 的仿射映射,与歌诀逐条相符;八个字中只有四个自由,可能的四柱共 518,400 种。
数据口径:书中以标注框区分已发表的证据、可运行的 Python 计算(16 段程序)、原典与作者的假说。
对照数据表
下表数字由本章 Python 程序原样打印,可重新运行复现。 与结论吻合的打印值: 10, 518400, 60
five tigers verse = (2 (Y mod 5) + 2) mod 10: True
five rats verse = 2 (D mod 5) mod 10: True
hours of a jia day:
jia-zi yi-chou bing-yin ding-mao wu-chen ji-si
geng-wu xin-wei ren-shen gui-you jia-xu yi-hai
months of a jia year, from the yin month:
bing-yin ding-mao wu-chen ji-si geng-wu xin-wei
ren-shen gui-you jia-xu yi-hai bing-zi ding-chou
every month and hour pillar has stem and branch of equal
parity: True
distinct charts: 60 years x 12 months x 60 days x 12 hours = 518,400
Reading: the month stem is fixed by the year stem and the
month, the hour stem by the day stem and the hour; the rhyming
tables are affine maps modulo 10. Of the eight characters only
four are free, giving 518,400 possible charts.核心公式
\[\mathrm{JDN} = d + \lfloor (153m' + 2)/5 \rfloor + 365y' + \lfloor y'/4 \rfloor - \lfloor y'/100 \rfloor + \lfloor y'/400 \rfloor - 32045.\]
查看完整验算程序
# Chapter 1. Month and hour stems as affine maps (five tigers, five rats).
# Index stems 0-9 (jia ... gui) and branches 0-11 (zi ... hai).
# Month: the yin month (branch 2) of a year with stem Y has stem
# (2 (Y mod 5) + 2) mod 10, and each later month adds one (the zi
# and chou months close the year, after hai).
# Hour: the zi hour (branch 0) of a day with stem D has stem
# 2 (D mod 5) mod 10, and each later hour adds one.
# Both are checked against the rhyming tables as usually printed.
STEMS = ("jia", "yi", "bing", "ding", "wu", "ji", "geng", "xin", "ren",
"gui")
BRANCHES = ("zi", "chou", "yin", "mao", "chen", "si", "wu", "wei", "shen",
"you", "xu", "hai")
# five tigers: year stems -> stem of the yin month
TIGERS = {("jia", "ji"): "bing", ("yi", "geng"): "wu",
("bing", "xin"): "geng", ("ding", "ren"): "ren",
("wu", "gui"): "jia"}
# five rats: day stems -> stem of the zi hour
RATS = {("jia", "ji"): "jia", ("yi", "geng"): "bing",
("bing", "xin"): "wu", ("ding", "ren"): "geng",
("wu", "gui"): "ren"}
def month_stem(year_stem, branch):
return (2 * (year_stem % 5) + 2 + (branch - 2) % 12) % 10
def hour_stem(day_stem, branch):
return (2 * (day_stem % 5) + branch) % 10
if __name__ == "__main__":
ok_t = all(STEMS[month_stem(STEMS.index(c), 2)] == v
for k, v in TIGERS.items() for c in k)
ok_r = all(STEMS[hour_stem(STEMS.index(c), 0)] == v
for k, v in RATS.items() for c in k)
print(" five tigers verse = (2 (Y mod 5) + 2) mod 10: {}".format(ok_t))
print(" five rats verse = 2 (D mod 5) mod 10: {}".format(ok_r))
hrs = [STEMS[hour_stem(0, b)] + "-" + BRANCHES[b] for b in range(12)]
mos = [STEMS[month_stem(0, b)] + "-" + BRANCHES[b]
for b in list(range(2, 12)) + [0, 1]]
print(" hours of a jia day:")
print(" " + " ".join(hrs[:6]))
print(" " + " ".join(hrs[6:]))
print(" months of a jia year, from the yin month:")
print(" " + " ".join(mos[:6]))
print(" " + " ".join(mos[6:]))
par = all((month_stem(y, b) - b) % 2 == 0 and (hour_stem(y, b) - b) % 2
== 0 for y in range(10) for b in range(12))
print(" every month and hour pillar has stem and branch of equal")
print(" parity: {}".format(par))
n = 60 * 12 * 60 * 12
print(" distinct charts: 60 years x 12 months x 60 days x 12 hours"
" = {:,d}".format(n))
print("\nReading: the month stem is fixed by the year stem and the")
print("month, the hour stem by the day stem and the hour; the rhyming")
print("tables are affine maps modulo 10. Of the eight characters only")
print("four are free, giving 518,400 possible charts.")唯一数据源与引用
范雅福(Fan, Y.). (2026). 《四柱排盘的历法计算与规则引擎》第 1 章「儒略日与四柱的同余公式」(版本 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.24090180
DOI: 10.5281/zenodo.24090180 · 阅读本章所在专著 · 5DL-B-066 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026066,
author = {Fan, Yafu},
title = {Four-Pillar Calendrical Computation and Formal Rule Engines},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
doi = {10.5281/zenodo.24090180},
url = {https://doi.org/10.5281/zenodo.24090180}
}