OFFSET
1,3
COMMENTS
The Mathematica coding used by Robert G. Wilson v implements Binet's Fibonacci number formula as suggested by David W. Wilson and incorporates Benoit Cloitre's use of logarithms to achieve a further increase in speed.
Fixed points of A020344. - Alois P. Heinz, Jul 08 2022
LINKS
Ron Knott, Fibonacci Numbers and the Golden Section
Eric Weisstein's World of Mathematics, Fibonacci numbers
FORMULA
n>5 is in the sequence if a=(1+sqrt(5))/2 b=1/sqrt(5) and n==floor(b*(a^n)/10^(floor((log(b) +n*log(a))/log(10))-floor(log(n)/log(10))) ). - Benoit Cloitre, Feb 27 2002
EXAMPLE
a(3)=43 since 43rd Fibonacci number starts with 43 -> {43}3494437.
Fibonacci(53) is 53316291173, which begins with 53, so 53 is a term in the sequence.
MATHEMATICA
a = N[ Log[10, Sqrt[5]/5], 24]; b = N [Log[10, GoldenRatio], 24]; Do[ If[ IntegerPart[10^FractionalPart[a + n*b]*10^Floor[ Log[10, n]]] == n, Print[n]], {n, 225000000}] (* Robert G. Wilson v, May 09 2005 *)
(* confirmed with: *) fQ[n_] := (FromDigits[ Take[ IntegerDigits[ Fibonacci[n]], Floor[ Log[10, n] + 1]]] == n)
PROG
(PARI) /* To obtain terms > 5: */ a=(1+sqrt(5))/2; b=1/sqrt(5); for(n=1, 3500, if(n==floor(b*(a^n)/10^( floor(log(b *(a^n))/log(10))-floor(log(n)/log(10)))), print1(n, ", "))) \\ Benoit Cloitre, Feb 27 2002
CROSSREFS
KEYWORD
nonn,base,nice
AUTHOR
EXTENSIONS
Term a(6) from Patrick De Geest, Oct 15 1999
a(7) from Benoit Cloitre, Feb 27 2002
a(8)-a(11) from Robert G. Wilson v, May 09 2005
a(12) from Robert G. Wilson v, May 11 2005
More terms from Robert Gerbicz, Aug 22 2006
STATUS
approved