cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A087172 Greatest Fibonacci number that does not exceed n.

This page as a plain text file.
%I A087172 #60 Feb 16 2025 08:32:51
%S A087172 1,2,3,3,5,5,5,8,8,8,8,8,13,13,13,13,13,13,13,13,21,21,21,21,21,21,21,
%T A087172 21,21,21,21,21,21,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,
%U A087172 34,34,34,34,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55
%N A087172 Greatest Fibonacci number that does not exceed n.
%C A087172 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
%C A087172 Fibonacci(n) occurs Fibonacci(n-1) times, for n >= 2. - _Benoit Cloitre_, Dec 15 2022
%H A087172 Reinhard Zumkeller, <a href="/A087172/b087172.txt">Table of n, a(n) for n = 1..10000</a>
%H A087172 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/FibonacciNumber.html">Fibonacci Number</a>.
%F A087172 a(n) = Fibonacci(A130233(n)) = Fibonacci(A130234(n+1)-1). - _Hieronymus Fischer_, May 28 2007
%F A087172 a(n) = A035516(n, 0) = A035517(n, A007895(n)-1). - _Reinhard Zumkeller_, Mar 10 2013
%F A087172 a(n) = n - A066628(n). - _Michel Marcus_, Feb 02 2016
%F A087172 Sum_{n>=1} 1/a(n)^2 = Sum_{n>=1} Fibonacci(n)/Fibonacci(n+1)^2 = 1.7947486789... . - _Amiram Eldar_, Aug 16 2022
%p A087172 with(combinat):
%p A087172 A087172 := proc (n) local j: for j while fibonacci(j) <= n do fibonacci(j) end do: fibonacci(j-1) end proc:
%p A087172 seq(A087172(n), n = 1 .. 40); # _Emeric Deutsch_, Nov 11 2014
%p A087172 # Alternative
%p A087172 N:= 100: # to get a(n) for n from 1 to N
%p A087172 Fibs:= [seq(combinat:-fibonacci(i), i = 1 .. ceil(log[(1 + sqrt(5))/2](sqrt(5)*N)))]:
%p A087172 A:= Vector(N):
%p A087172 for i from 1 to nops(Fibs)-1 do
%p A087172   A[Fibs[i] .. min(N,Fibs[i+1]-1)]:= Fibs[i]
%p A087172 od:
%p A087172 convert(A,list); # _Robert Israel_, Nov 11 2014
%t A087172 With[{rf=Reverse[Fibonacci[Range[10]]]},Flatten[Table[ Select[ rf,n>=#&, 1],{n,80}]]] (* _Harvey P. Dale_, Dec 08 2012 *)
%t A087172 Flatten[Map[ConstantArray[Fibonacci[#],Fibonacci[#-1]]&,Range[15]]] (* _Peter J. C. Moses_, May 02 2022 *)
%o A087172 (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
%o A087172 (Haskell)
%o A087172 a087172 = head . a035516_row -- _Reinhard Zumkeller_, Mar 10 2013
%Y A087172 Cf. A000045, A007895, A035516, A035517, A066628, A107017, A130233, A130234, A256654.
%Y A087172 Partial sums: A130473.
%K A087172 nonn,easy
%O A087172 1,2
%A A087172 _Sam Alexander_, Oct 19 2003