%I #21 Nov 21 2019 00:11:42
%S 0,-1,5,3,9,8,12,14,16,22,25,27,30,33,39,44,42,49,52,51,56,55,64,70,
%T 73,77,81,83,82,85,88,92,93,99,101,104,109,104,111,114,117,120,122,
%U 124,126,129,131,133,136,139,138,144,138,148,151,150,153,156,158,162
%N Number of binary places to which n-th convergent of continued fraction expansion of Khintchine's constant matches the correct value.
%C For number of correct decimal digits see A317908.
%C For the similar case of number of correct binary digits of Pi see A305879.
%C For the similar case of number of correct binary digits of log(2) see A317557.
%C The denominator of the k-th convergent obtained from a continued fraction satisfying the Gauss-Kuzmin distribution will tend to exp(k*A100199), A100199 being the inverse of Lévy's constant; the error between the k-th convergent and the constant itself tends to exp(-2*k*A100199), or in binary digits 2*k*A100199/log(2) bits after the binary point.
%C The sequence for quaternary digits is obtained by floor(a(n)/2), the sequence for octal digits is obtained by floor(a(n)/3), and the sequence for hexadecimal digits is obtained by floor(a(n)/4).
%H A.H.M. Smeets, <a href="/A317907/b317907.txt">Table of n, a(n) for n = 1..19999</a>
%F Lim_{n -> oo} a(n)/n = 2*log(A086702)/log(2) = 2*A100199/log(2) = 2*A305607.
%e n convergent binary expansion a(n)
%e == ============= ========================== ====
%e 1 2 / 1 10.0... 0
%e 2 3 / 1 11.0... -1
%e 3 8 / 3 10.101010... 5
%e 4 43 / 16 10.1011... 3
%e 5 51 / 19 10.1010111100... 9
%e oo lim = A317906 10.101011110111100111... --
%o (Python)
%o i,cf = 0,[]
%o while i <= 20100:
%o ....c = A002211(i)
%o ....cf,i = cf+[c],i+1
%o p0,p1,q0,q1,i,base = cf[0],1,1,0,1,2
%o while i <= 20100:
%o ....p0,p1,q0,q1,i = cf[i]*p0+p1,p0,cf[i]*q0+q1,q0,i+1
%o a0 = p0//q0
%o p0 = p0-a0*q0
%o i,p0,dd = 0,p0*base,[a0]
%o while i < 70000:
%o ....d,p0,i = p0//q0,(p0%q0)*base,i+1
%o ....dd = dd+[d]
%o n,pn0,pn1,qn0,qn1 = 1,a0,1,1,0
%o while n <= 20000:
%o ....p,q = pn0,qn0
%o ....if p//q != a0:
%o ........print(n,"- manual!")
%o ....else:
%o ........i,p,di = 0,(p%q)*base,a0
%o ........while di == dd[i]:
%o ............i,di,p = i+1,p//q,(p%q)*base
%o ........print(n,i-1)
%o ....n,pn0,pn1,qn0,qn1 = n+1,cf[n]*pn0+pn1,pn0,cf[n]*qn0+qn1,qn0
%Y Cf. A002210, A002211, A086702, A100199, A305607, A317906, A317908.
%K sign,base
%O 1,3
%A _A.H.M. Smeets_, Aug 10 2018