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.

A318058 a(n) is the number of decimal places to which the n-th convergent of the continued fraction expansion of the golden section matches the correct value.

This page as a plain text file.
%I A318058 #24 Nov 04 2024 18:13:20
%S A318058 0,-1,0,1,1,1,2,2,2,3,2,4,4,5,5,5,6,5,7,7,8,7,9,9,9,10,10,10,11,10,12,
%T A318058 12,13,12,13,14,15,14,15,16,16,16,17,17,17,18,18,19,18,20,20,21,21,21,
%U A318058 22,22,23,23,24,23,24,25,25,26,26,27,27,27,28,28,29,29,29,30,30
%N A318058 a(n) is the number of decimal places to which the n-th convergent of the continued fraction expansion of the golden section matches the correct value.
%C A318058 The correct decimal value of the golden section is given in A001622; the continued fraction terms of the golden section is given in A000012.
%C A318058 For the number of correct decimal digits of the golden section see A318057.
%C A318058 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.
%F A318058 Limit_{n -> oo} a(n)/n = 2*log(A001622)/log(10) = 2*A002390/log(10) = A202543/log(10) = 2*A097348.
%e A318058    n   convergent         decimal expansion     a(n)
%e A318058   ==  =============  =========================  ====
%e A318058    1    1 / 1         1.0                         0
%e A318058    2    2 / 1         2.0                        -1
%e A318058    3    3 / 2         1.5                         0
%e A318058    4    5 / 3         1.66                        1
%e A318058    5    8 / 5         1.60                        1
%e A318058    6   13 / 8         1.62                        1
%e A318058    7   21 / 13        1.615                       2
%e A318058    8   34 / 21        1.619                       2
%e A318058    9   55 / 34        1.617                       2
%e A318058   10   89 / 55        1.6181                      3
%e A318058   oo  lim = A001622   1.6180339887498948482      --
%o A318058 (Python)
%o A318058 p, q, i, base = 1, 1, 0, 10
%o A318058 while i < 20200:
%o A318058     p, q, i = p+q, p, i+1
%o A318058 a0, p, q = p//q, q, p
%o A318058 i, p, dd = 0, p*base, [0]
%o A318058 while i < 30000:
%o A318058     d, p, i = p//q, (p%q)*base, i+1
%o A318058     dd = dd+[d]
%o A318058 n, pn, qn = 0, 1, 0
%o A318058 while n < 20000:
%o A318058     n, pn, qn = n+1, pn+qn, pn
%o A318058     if pn//qn != a0:
%o A318058         print(n, "- manual!")
%o A318058     else:
%o A318058         i, p, q, di = 0, (pn%qn)*base, qn, 0
%o A318058         while di == dd[i]:
%o A318058             i, di, p = i+1, p//q, (p%q)*base
%o A318058         print(n, i-1)
%Y A318058 Cf. A000012, A001622, A002390, A097348, A202543, A318057.
%K A318058 sign,base
%O A318058 1,7
%A A318058 _A.H.M. Smeets_, Aug 14 2018