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.
%I A318057 #19 Nov 04 2024 18:15:31 %S A318057 0,-2,3,2,5,2,6,9,10,9,13,12,15,16,19,16,20,22,24,25,27,29,28,30,33, %T A318057 32,36,32,38,32,41,42,44,45,46,47,50,48,52,54,53,56,53,58,59,60,64,62, %U A318057 66,62,67,69,71,73,75,74,77,78,80,82,81,84,81,87,81,88,90 %N A318057 a(n) is the number of binary places to which n-th convergent of continued fraction expansion of the golden section matches the correct value. %C A318057 The correct binary value of the golden section is given in A068432; the continued fraction terms of the golden section is given in A000012. %C A318057 For the number of correct decimal digits of the golden section see A318058. %C A318057 The denominator of the k-th convergent obtained from a continued fraction tend to k*A001622; the error between the k-th convergent and the constant itself tends to 1/(2*k*A001622), or in binary digits 2*k*log(A001622)/log(2) bits after the binary point. %C A318057 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). %F A318057 Lim {n -> oo} a(n)/n = 2*log(A001622)/log(2) = 2*A002390/log(2) = A202543/log(2) = 2*A242208. %e A318057 n convergent binary expansion a(n) %e A318057 == ============= ========================== ==== %e A318057 1 1 / 1 1.0 0 %e A318057 2 2 / 1 10.0 -2 %e A318057 3 3 / 2 1.1000 3 %e A318057 4 5 / 3 1.101 2 %e A318057 5 8 / 5 1.100110 5 %e A318057 6 13 / 8 1.101 2 %e A318057 7 21 / 13 1.1001110 6 %e A318057 8 34 / 21 1.1001111001 9 %e A318057 9 55 / 34 1.10011110000 10 %e A318057 10 89 / 55 1.1001111001 9 %e A318057 oo lim = A068432 1.1001111000110111011110 -- %o A318057 (Python) %o A318057 p, q, i, base = 1, 1, 0, 2 %o A318057 while i < 20200: %o A318057 p, q, i = p+q, p, i+1 %o A318057 a0, p, q = p//q, q, p %o A318057 i, p, dd = 0, p*base, [0] %o A318057 while i < 30000: %o A318057 d, p, i = p//q, (p%q)*base, i+1 %o A318057 dd = dd+[d] %o A318057 n, pn, qn = 0, 1, 0 %o A318057 while n < 20000: %o A318057 n, pn, qn = n+1, pn+qn, pn %o A318057 if pn//qn != a0: %o A318057 print(n, "- manual!") %o A318057 else: %o A318057 i, p, q, di = 0, (pn%qn)*base, qn, 0 %o A318057 while di == dd[i]: %o A318057 i, di, p = i+1, p//q, (p%q)*base %o A318057 print(n, i-1) %Y A318057 Cf. A000012, A001622, A002390, A068432, A202543, A242208, A318058. %K A318057 sign,base %O A318057 1,2 %A A318057 _A.H.M. Smeets_, Aug 14 2018