OFFSET
1,2
COMMENTS
Also the largest term in Zeckendorf representation of n; starting at Fibonacci positions the sequence is repeated again and again in A107017: A107017(A000045(n)+k) = a(k) with 0 < k < A000045(n-1). - Reinhard Zumkeller, May 09 2005
Fibonacci(n) occurs Fibonacci(n-1) times, for n >= 2. - Benoit Cloitre, Dec 15 2022
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
Eric Weisstein's World of Mathematics, Fibonacci Number.
FORMULA
a(n) = n - A066628(n). - Michel Marcus, Feb 02 2016
Sum_{n>=1} 1/a(n)^2 = Sum_{n>=1} Fibonacci(n)/Fibonacci(n+1)^2 = 1.7947486789... . - Amiram Eldar, Aug 16 2022
MAPLE
with(combinat):
A087172 := proc (n) local j: for j while fibonacci(j) <= n do fibonacci(j) end do: fibonacci(j-1) end proc:
seq(A087172(n), n = 1 .. 40); # Emeric Deutsch, Nov 11 2014
# Alternative
N:= 100: # to get a(n) for n from 1 to N
Fibs:= [seq(combinat:-fibonacci(i), i = 1 .. ceil(log[(1 + sqrt(5))/2](sqrt(5)*N)))]:
A:= Vector(N):
for i from 1 to nops(Fibs)-1 do
A[Fibs[i] .. min(N, Fibs[i+1]-1)]:= Fibs[i]
od:
convert(A, list); # Robert Israel, Nov 11 2014
MATHEMATICA
With[{rf=Reverse[Fibonacci[Range[10]]]}, Flatten[Table[ Select[ rf, n>=#&, 1], {n, 80}]]] (* Harvey P. Dale, Dec 08 2012 *)
Flatten[Map[ConstantArray[Fibonacci[#], Fibonacci[#-1]]&, Range[15]]] (* Peter J. C. Moses, May 02 2022 *)
PROG
(PARI) a(n)=my(k=log(n)\log((1+sqrt(5))/2)); while(fibonacci(k)<=n, k++); fibonacci(k--) \\ Charles R Greathouse IV, Jul 24 2012
(Haskell)
a087172 = head . a035516_row -- Reinhard Zumkeller, Mar 10 2013
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Sam Alexander, Oct 19 2003
STATUS
approved