login
Number of digits of phi (the golden ratio) correctly approximated by Fibonacci(n+1) / Fibonacci(n).
1

%I #46 Feb 03 2024 10:12:37

%S 1,0,1,2,2,2,3,3,3,4,3,5,5,6,6,6,7,6,8,8,9,8,10,10,10,11,11,11,12,11,

%T 13,13,14,13,14,15,16,15,16,17,17,17,18,18,18,19,19,20,19,21,21,22,22,

%U 22,23,23,24,24,25,24,25,26,26,27,27,28,28,28,29,29,30,30,30

%N Number of digits of phi (the golden ratio) correctly approximated by Fibonacci(n+1) / Fibonacci(n).

%H David Consiglio, Jr., <a href="/A369715/b369715.txt">Table of n, a(n) for n = 1..1000</a>

%e For n=1, 1/1 = 1 matches the first digit of phi (1.618033), so a(1) = 1

%e For n=2, 2/1 = 2 which matches no digits of phi (1.618033), so a(2) = 0

%e For n=12,

%e F(13)/F(12) = 1.6180 55... = 233/144

%e phi = 1.6180 33...

%e ^ ^^^^ a(12) = 5 matching digits

%o (Python)

%o from math import isqrt

%o fib = [1,1]

%o terms = []

%o while len(terms) < 1000:

%o deg = 0

%o target = 0

%o test = 0

%o while target == test:

%o target = (10**deg+isqrt(5*10**(2*deg)))//2

%o test = (10**deg*(fib[-1]))//fib[-2]

%o deg += 1

%o terms.append(deg-1)

%o fib.append(fib[-1]+fib[-2])

%o print(terms)

%Y Cf. A000045, A001622, A048433, A048434.

%K nonn,base

%O 1,4

%A _David Consiglio, Jr._, Jan 31 2024