OFFSET
0,1
EXAMPLE
0.5815803358828329856145006072280655247763056696200923013621215551576710...
PROG
(Python) # Using `sample_gauss_kuzmin_distribution` function from A084580.
from mpmath import mp, iv
def decimal_from_cf(coeffs):
num = iv.mpf([coeffs[-1], coeffs[-1]+1])
for coeff in coeffs[-2::-1]:
num = coeff + 1/iv.mpf(num)
return 1/num
def get_matching_digits(interval_a, interval_b):
match_index = 0
for i, j in zip(interval_a, interval_b):
if i != j: break
match_index += 1
return interval_a[:match_index]
def compute_kuzmin_digits(prec, num_coeffs):
assert prec > num_coeffs
mp.dps = iv.dps = prec
coeffs = sample_gauss_kuzmin_distribution(num_coeffs)
x = decimal_from_cf(coeffs)
a = mp.nstr(mp.mpf(x.a), n=prec, strip_zeros=False)
b = mp.nstr(mp.mpf(x.b), n=prec, strip_zeros=False)
return get_matching_digits(a, b)
num = compute_kuzmin_digits(prec=200, num_coeffs=180)
A372869 = [int(d) for d in num[1:] if d != '.']
CROSSREFS
KEYWORD
cons,nonn
AUTHOR
Jwalin Bhatt, Jul 04 2024
STATUS
approved