# ratios1326.py -- job #1326 / route 24: extend #584's m* table with T_31 (and T_37 when present) and decompose m*/N. # m*/N = (m* * gbar / (4 Ghat)) * (4 Ghat / (gbar * N)), gbar = x#/D the mean tile gap. The first factor is the densest-window # efficiency c(x); the second is set by the published Ghat ladder alone. import json, os from fractions import Fraction as F def primes(n): return [p for p in range(2, n + 1) if all(p % d for d in range(2, int(p ** .5) + 1))] def pi(n): return len(primes(n)) GHAT = {13: 66, 17: 108, 19: 150, 23: 204, 29: 258, 31: 348, 37: 528} MSTAR = {13: 9, 17: 12, 19: 15, 23: 18, 29: 20} # #584 (mstar.py / mstar29.py), reproduced in gate_small.jsonl SRC = {x: '#584' for x in MSTAR} for x, f in ((31, 't31.json'), (37, 't37.json')): if os.path.exists(f): d = json.load(open(f)); P = 1 for p in primes(x): P *= p D = 1 for p in primes(x)[1:]: D *= p - 2 assert d['gapsum'] == P and d['D'] == D and d['maxsum'][0] == GHAT[x] and d['THR'] == 4 * GHAT[x], x MSTAR[x] = d['mstar']; SRC[x] = 'this job (' + f + ')' SUP_PAID = F(17, 5) # sup K*/N over the enumerable steps (#586: 17/5 at 13#->31#) print('%3s %3s %4s %5s %8s %7s %7s %7s %s' % ('x', 'N', 'm*', 'Ghat', 'gbar', 'm*/N', 'c(x)', '4G/gN', 'source')) prev = None for x in sorted(MSTAR): N = pi(2 * x) - pi(x); P = 1 for p in primes(x): P *= p D = 1 for p in primes(x)[1:]: D *= p - 2 gbar = P / D; m = MSTAR[x]; c = m * gbar / (4 * GHAT[x]); r = 4 * GHAT[x] / (gbar * N) flag = '>' if F(m, N) > SUP_PAID else '<=' if F(m, N) == SUP_PAID else '<' print('%3d %3d %4d %5d %8.3f %7.4f %7.4f %7.4f %s; m*/N %s 17/5%s' % (x, N, m, GHAT[x], gbar, m / N, c, r, SRC[x], flag, '' if prev is None else '; dm*/dN = %s' % (F(m - prev[1], N - prev[0]) if N != prev[0] else 'n/a (dN = 0)'))) prev = (N, m)