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.
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, 32, 36, 32, 38, 32, 41, 42, 44, 45, 46, 47, 50, 48, 52, 54, 53, 56, 53, 58, 59, 60, 64, 62, 66, 62, 67, 69, 71, 73, 75, 74, 77, 78, 80, 82, 81, 84, 81, 87, 81, 88, 90
Offset: 1
Examples
n convergent binary expansion a(n) == ============= ========================== ==== 1 1 / 1 1.0 0 2 2 / 1 10.0 -2 3 3 / 2 1.1000 3 4 5 / 3 1.101 2 5 8 / 5 1.100110 5 6 13 / 8 1.101 2 7 21 / 13 1.1001110 6 8 34 / 21 1.1001111001 9 9 55 / 34 1.10011110000 10 10 89 / 55 1.1001111001 9 oo lim = A068432 1.1001111000110111011110 --
Programs
-
Python
p, q, i, base = 1, 1, 0, 2 while i < 20200: p, q, i = p+q, p, i+1 a0, p, q = p//q, q, p i, p, dd = 0, p*base, [0] while i < 30000: d, p, i = p//q, (p%q)*base, i+1 dd = dd+[d] n, pn, qn = 0, 1, 0 while n < 20000: n, pn, qn = n+1, pn+qn, pn if pn//qn != a0: print(n, "- manual!") else: i, p, q, di = 0, (pn%qn)*base, qn, 0 while di == dd[i]: i, di, p = i+1, p//q, (p%q)*base print(n, i-1)
Comments