Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #59 Dec 26 2024 13:28:36
%S 5,8,1,5,8,0,3,3,5,8,8,2,8,3,2,9,8,5,6,1,4,5,0,0,6,0,7,2,2,8,0,6,5,5,
%T 2,4,7,7,6,3,0,5,6,6,9,6,2,0,0,9,2,3,0,1,3,6,2,1,2,1,5,5,5,1,5,7,6,7,
%U 1,0,4,9,1,2,4,1,9,5,3,4,0,8,9,4,9,2,0,1,2,6,9,4,1,4,2,1,2,9,0,9,2,8,0,5,9,2,1,2,8,8,7,8,6,1,7,6,8,0,8,0,4,1,3,2,1,3,6,3,7,5,7,8,3,2,6
%N Decimal expansion of the number whose continued fraction coefficients are given in A084580.
%e 0.5815803358828329856145006072280655247763056696200923013621215551576710...
%o (Python) # Using `sample_gauss_kuzmin_distribution` function from A084580.
%o from mpmath import mp, iv
%o def decimal_from_cf(coeffs):
%o num = iv.mpf([coeffs[-1], coeffs[-1]+1])
%o for coeff in coeffs[-2::-1]:
%o num = coeff + 1/iv.mpf(num)
%o return 1/num
%o def get_matching_digits(interval_a, interval_b):
%o match_index = 0
%o for i, j in zip(interval_a, interval_b):
%o if i != j: break
%o match_index += 1
%o return interval_a[:match_index]
%o def compute_kuzmin_digits(prec, num_coeffs):
%o assert prec > num_coeffs
%o mp.dps = iv.dps = prec
%o coeffs = sample_gauss_kuzmin_distribution(num_coeffs)
%o x = decimal_from_cf(coeffs)
%o a = mp.nstr(mp.mpf(x.a), n=prec, strip_zeros=False)
%o b = mp.nstr(mp.mpf(x.b), n=prec, strip_zeros=False)
%o return get_matching_digits(a, b)
%o num = compute_kuzmin_digits(prec=200, num_coeffs=180)
%o A372869 = [int(d) for d in num[1:] if d != '.']
%Y Cf. A084580 (continued fraction).
%K cons,nonn
%O 0,1
%A _Jwalin Bhatt_, Jul 04 2024