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.

Showing 1-2 of 2 results.

A317557 Number of binary digits to which the n-th convergent of the continued fraction expansion of log(2) matches the correct value.

Original entry on oeis.org

0, -1, 3, 6, 9, 13, 14, 17, 19, 20, 23, 20, 25, 20, 33, 37, 35, 38, 41, 43, 45, 43, 47, 48, 52, 54, 58, 61, 68, 70, 74, 77, 78, 81, 86, 89, 92, 93, 92, 99, 105, 109, 113, 116, 118, 121, 127, 133, 136, 135, 139, 141, 145, 149, 154, 159, 161, 165, 171, 173, 172, 180
Offset: 1

Views

Author

A.H.M. Smeets, Jul 31 2018

Keywords

Comments

Binary expansion of log(2) in A068426.
For number of correct decimal digits see A317558.
For the similar case of number of correct binary digits of Pi see A305879.
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.
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).

Examples

			   n   convergent         binary expansion         a(n)
  ==  ============  =============================  ====
   1     0 / 1      0.0                              0
   2     1 / 1      1.0                             -1
   3     2 / 3      0.1010...                        3
   4     7 / 10     0.1011001...                     6
   5     9 / 13     0.1011000100...                  9
   6    61 / 88     0.10110001011101...             13
   7   192 / 277    0.101100010111000...            14
   8   253 / 365    0.101100010111001001...         17
   9   445 / 642    0.10110001011100100000...       19
  10  1143 / 1649   0.101100010111001000011...      20
  oo  lim = log(2)  0.101100010111001000010111...   --
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Block[{k = 1, a = RealDigits[ Log@2, 2, 4 + 10][[1]], b = RealDigits[ FromContinuedFraction@ ContinuedFraction[Log@2, n + 1], 2, 4n + 10][[1]]}, While[ a[[k]] == b[[k]], k++]; k - 1]; a[1] = 0; a[2] = -1; Array[a, 61] (* Robert G. Wilson v, Aug 09 2018 *)

Formula

Lim_{n -> oo} a(n)/n = 2*log(A086702)/log(2) = 2*A100199/log(2) = 2*A305607.

Extensions

a(40) onward from Robert G. Wilson v, Aug 09 2018

A317907 Number of binary places to which n-th convergent of continued fraction expansion of Khintchine's constant matches the correct value.

Original entry on oeis.org

0, -1, 5, 3, 9, 8, 12, 14, 16, 22, 25, 27, 30, 33, 39, 44, 42, 49, 52, 51, 56, 55, 64, 70, 73, 77, 81, 83, 82, 85, 88, 92, 93, 99, 101, 104, 109, 104, 111, 114, 117, 120, 122, 124, 126, 129, 131, 133, 136, 139, 138, 144, 138, 148, 151, 150, 153, 156, 158, 162
Offset: 1

Views

Author

A.H.M. Smeets, Aug 10 2018

Keywords

Comments

For number of correct decimal digits see A317908.
For the similar case of number of correct binary digits of Pi see A305879.
For the similar case of number of correct binary digits of log(2) see A317557.
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.
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).

Examples

			   n   convergent         binary expansion       a(n)
  ==  =============  ==========================  ====
   1     2 / 1       10.0...                       0
   2     3 / 1       11.0...                      -1
   3     8 / 3       10.101010...                  5
   4    43 / 16      10.1011...                    3
   5    51 / 19      10.1010111100...              9
  oo  lim = A317906  10.101011110111100111...     --
		

Crossrefs

Programs

  • Python
    i,cf = 0,[]
    while i <= 20100:
        c = A002211(i)
        cf,i = cf+[c],i+1
    p0,p1,q0,q1,i,base = cf[0],1,1,0,1,2
    while i <= 20100:
        p0,p1,q0,q1,i = cf[i]*p0+p1,p0,cf[i]*q0+q1,q0,i+1
    a0 = p0//q0
    p0 = p0-a0*q0
    i,p0,dd = 0,p0*base,[a0]
    while i < 70000:
        d,p0,i = p0//q0,(p0%q0)*base,i+1
        dd = dd+[d]
    n,pn0,pn1,qn0,qn1 = 1,a0,1,1,0
    while n <= 20000:
        p,q = pn0,qn0
        if p//q != a0:
            print(n,"- manual!")
        else:
            i,p,di = 0,(p%q)*base,a0
            while di == dd[i]:
                i,di,p = i+1,p//q,(p%q)*base
            print(n,i-1)
        n,pn0,pn1,qn0,qn1 = n+1,cf[n]*pn0+pn1,pn0,cf[n]*qn0+qn1,qn0

Formula

Lim_{n -> oo} a(n)/n = 2*log(A086702)/log(2) = 2*A100199/log(2) = 2*A305607.
Showing 1-2 of 2 results.