cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A372869 Decimal expansion of the number whose continued fraction coefficients are given in A084580.

This page as a plain text file.
%I A372869 #59 Dec 26 2024 13:28:36
%S A372869 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 A372869 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 A372869 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 A372869 Decimal expansion of the number whose continued fraction coefficients are given in A084580.
%e A372869 0.5815803358828329856145006072280655247763056696200923013621215551576710...
%o A372869 (Python) # Using `sample_gauss_kuzmin_distribution` function from A084580.
%o A372869 from mpmath import mp, iv
%o A372869 def decimal_from_cf(coeffs):
%o A372869     num = iv.mpf([coeffs[-1], coeffs[-1]+1])
%o A372869     for coeff in coeffs[-2::-1]:
%o A372869         num = coeff + 1/iv.mpf(num)
%o A372869     return 1/num
%o A372869 def get_matching_digits(interval_a, interval_b):
%o A372869     match_index = 0
%o A372869     for i, j in zip(interval_a, interval_b):
%o A372869         if i != j:  break
%o A372869         match_index += 1
%o A372869     return interval_a[:match_index]
%o A372869 def compute_kuzmin_digits(prec, num_coeffs):
%o A372869     assert prec > num_coeffs
%o A372869     mp.dps = iv.dps = prec
%o A372869     coeffs = sample_gauss_kuzmin_distribution(num_coeffs)
%o A372869     x = decimal_from_cf(coeffs)
%o A372869     a = mp.nstr(mp.mpf(x.a), n=prec, strip_zeros=False)
%o A372869     b = mp.nstr(mp.mpf(x.b), n=prec, strip_zeros=False)
%o A372869     return get_matching_digits(a, b)
%o A372869 num = compute_kuzmin_digits(prec=200, num_coeffs=180)
%o A372869 A372869 = [int(d) for d in num[1:] if d != '.']
%Y A372869 Cf. A084580 (continued fraction).
%K A372869 cons,nonn
%O A372869 0,1
%A A372869 _Jwalin Bhatt_, Jul 04 2024