import numberdb.sage as numberdb
from sage.rings.integer_ring import ZZ
from sage.rings.rational_field import QQ
from sage.rings.real_mpfi import RealIntervalField
def liouville(b, digits=100):
raw = b
b = ZZ(b)
if isinstance(raw, (float, bool)) or str(b) != str(raw).strip() or b < 2:
raise ValueError("b must be an integer at least 2")
n, f = 1, 1
s = QQ(1) / b
while True:
g = f * (n + 1)
tail = QQ(1) / ((b - 1) * b**(g - 1))
if tail < QQ(1) / ZZ(10)**(digits + 15):
RIF = RealIntervalField(max(512, numberdb.bits(digits, losing=96)))
return RIF(s, s + tail)
n, f = n + 1, g
s += QQ(1) / b**f
liouville(10)Exact rational partial sums are enclosed using the geometric tail bound in (1), choosing $N$ so that the tail is less than $10^{-115}$. This gives $N=5$ for $2\leq b\leq9$ and $N=4$ for $10\leq b\leq16$. Both exact rational endpoints are converted outward by MPFI at 512 bits. The resulting finite, nonzero-width intervals are contained in the stored 100-significant-digit decimal intervals.
A separate implementation tests each positive digit position for factorial membership by successive integer division, then constructs an exact rational digit prefix by Horner evaluation. An all-position geometric tail below $10^{-175}$ bounds every continuation. It checked all 15 entries, the rational prefix recurrence and serialization containment. The first 150 decimal digits of $L_{10}$ and $L_2$ agree with [1] and [2]. Known-answer controls and deliberately wrong indexing, scaling, base and uncertainty controls passed. The attached checks and results retain the evidence. Long strings of zero digits do not make these infinite sums exact rationals.