What does Four-Pillar Computation conclude, in numbers, about “The Julian Day and the Congruences of the Four Pillars”?

Answer: Chapter 1 writes the day pillar as the residue of the Julian day plus 49 modulo 60, continuous across the reform of 1582, and the five-tigers and five-rats rules as affine maps modulo 10 that agree with the verses line by line; only four of the eight characters are free, giving 518,400 possible charts.

Scope of the numbers: Marked boxes separate published evidence, runnable Python calculations (16 programs), classical sources and the author's hypotheses.

中文版

Data table

The numbers below are printed verbatim by the chapter's Python program and can be reproduced by running it. printed values that match the answer: 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.

Key formula

\[\mathrm{JDN} = d + \lfloor (153m' + 2)/5 \rfloor + 365y' + \lfloor y'/4 \rfloor - \lfloor y'/100 \rfloor + \lfloor y'/400 \rfloor - 32045.\]
Show the full program
# 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.")

Single source and citation

Fan, Y. (2026). Four-Pillar Calendrical Computation and Formal Rule Engines (Version 1.0.0), Chapter 1: The Julian Day and the Congruences of the Four Pillars. 5D Library. https://doi.org/10.5281/zenodo.24090180

DOI: 10.5281/zenodo.24090180 · Read the monograph · 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}
}

Other chapter answers in this book