OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..990
FORMULA
EXAMPLE
a(3)=987, as 987 is largest 3-digit Fibonacci number.
MAPLE
fib:= combinat:-fibonacci:
g:= proc(x) local n;
n:= floor(ln((2*x+1)*sqrt(5)/2)/ln((1+sqrt(5))/2));
if fib(n) > x then while fib(n) > x do n:= n-1 od
elif fib(n+1) <= x then while fib(n+1) <= x do n:= n+1 od
fi;
fib(n)
end:
seq(g(10^n), n=1..50); # Robert Israel, Mar 10 2016
# second Maple program:
F:= proc(n) option remember; local f;
f:= `if`(n=1, [1$2], F(n-1));
do f:= [f[2], f[1]+f[2]];
if length(f[1])<length(f[2]) then break fi
od; f
end:
a:= n-> F(n)[1]:
seq(a(n), n=1..25); # Alois P. Heinz, Mar 10 2016
MATHEMATICA
Table[k=1; While[Fibonacci@++k<10^n]; Fibonacci[k-1], {n, 20}] (* Giorgos Kalogeropoulos, Jul 06 2021 *)
PROG
(Python)
def A072352_list(n):
list = []
x, y = 1, 1
while len(list) < n:
if len(str(x)) < len(str(y)):
list.append(x)
x, y = y, x + y
return list
print(A072352_list(20)) # M. Eren Kesim, Jun 28 2021
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Shyam Sunder Gupta, Jul 17 2002
STATUS
approved