import numberdb.sage as numberdb
from sage.rings.rational_field import QQ
from sage.rings.real_mpfi import RealIntervalField
from sage.sets.primes import Primes
def copeland_erdos(b, digits=100):
# Construct and read the prime blocks in the same integer radix b >= 2.
b = int(b)
if b < 2:
raise ValueError("b must be at least 2")
total, length = QQ(0), 0
for p in Primes():
q, width = int(p), 0
while q:
q //= b
width += 1
length += width
total += QQ(p) / b**length
if b**length > 10**(digits+15):
bits = max(512, numberdb.bits(digits, losing=100))
return RealIntervalField(bits)(total, total + QQ(1)/b**length)
values = {b: copeland_erdos(b) for b in range(2, 17)}
# The function also evaluates other construction radices, such as copeland_erdos(17).
Complete prime blocks were accumulated by exact integer arithmetic until $b^{L_n}>10^{115}$. Every continuation lies between the exact rational endpoints $A/b^{L_n}$ and $(A+1)/b^{L_n}$. Both endpoints were converted outward using MPFI at 512 bits. Each computed enclosure is contained in its stored 100-significant-digit decimal interval.
A separate implementation enumerated primes by trial division, derived block lengths by repeated integer division, and summed $\sum_{j=1}^n p_j/b^{L_j}$ as exact rationals. It checked the complete prefixes and interval containment for every radix from 2 through 16. Longer regression prefixes cross $b^2$ in every radix. Controls include the first 100 decimal digits of both the decimal and binary members from [2] and [3], known initial prime blocks, digit-length boundaries, exact repeating-digit streams and deliberately corrupted inputs. The attached programs and results retain these checks.