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.

Showing 1-2 of 2 results.

A087172 Greatest Fibonacci number that does not exceed n.

Original entry on oeis.org

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, 21, 21, 21, 21, 21, 21, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55
Offset: 1

Views

Author

Sam Alexander, Oct 19 2003

Keywords

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

Crossrefs

Programs

  • Haskell
    a087172 = head . a035516_row -- Reinhard Zumkeller, Mar 10 2013
  • 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 *)
  • 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
    

Formula

a(n) = Fibonacci(A130233(n)) = Fibonacci(A130234(n+1)-1). - Hieronymus Fischer, May 28 2007
a(n) = A035516(n, 0) = A035517(n, A007895(n)-1). - Reinhard Zumkeller, Mar 10 2013
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

A139764 Smallest term in Zeckendorf representation of n.

Original entry on oeis.org

1, 2, 3, 1, 5, 1, 2, 8, 1, 2, 3, 1, 13, 1, 2, 3, 1, 5, 1, 2, 21, 1, 2, 3, 1, 5, 1, 2, 8, 1, 2, 3, 1, 34, 1, 2, 3, 1, 5, 1, 2, 8, 1, 2, 3, 1, 13, 1, 2, 3, 1, 5, 1, 2, 55, 1, 2, 3, 1, 5, 1, 2, 8, 1, 2, 3, 1, 13, 1, 2, 3, 1, 5, 1, 2, 21, 1, 2, 3, 1, 5, 1, 2, 8, 1, 2, 3, 1, 89
Offset: 1

Views

Author

Steve Witham (sw(AT)tiac.net), May 15 2008

Keywords

Comments

Also called a "Fibonacci fractal".
Appears to be the same as the "ruler of Fibonaccis" mentioned by Knuth. - N. J. A. Sloane, Aug 03 2012
a(n) is also the number of matches to take away to win in a certain match game (see Rocher et al.).
The frequencies of occurrences of the values in this sequence and A035614 are related by the golden ratio.

Examples

			The Zeckendorf representation of 7 = 5 + 2, so a(7) = 2.
		

References

  • D. E. Knuth, The Art of Computer Programming, Vol. 4A, Section 7.1.3, p. 82, solution to Problem 179. - From N. J. A. Sloane, Aug 03 2012

Crossrefs

Programs

  • Haskell
    a139764 = head . a035517_row  -- Reinhard Zumkeller, Mar 10 2013
  • Maple
    A000045 := proc(n) combinat[fibonacci](n) ; end:
    A087172 := proc(n)
    local a,i ;
    a := 0 ;
    for i from 0 do
    if A000045(i) <= n then
    a := A000045(i) ;
    else
    RETURN(a) ;
    fi ;
    od:
    end:
    A139764 := proc(n)
    local nResid,prevF ;
    nResid := n ;
    while true do
    prevF := A087172(nResid) ;
    if prevF = nResid then
    RETURN(prevF) ;
    else
    nResid := nResid-prevF ;
    fi ;
    od:
    end:
    seq(A139764(n),n=1..120) ;
    # R. J. Mathar, May 22 2008
  • Mathematica
    f[n_] := (k = 1; ff = {}; While[(fi = Fibonacci[k]) <= n, AppendTo[ff, fi]; k++]; Drop[ff, 1]); a[n_] := First[ If[n == 0, 0, r = n; s = {}; fr = f[n]; While[r > 0, lf = Last[fr]; If[lf <= r, r = r - lf; PrependTo[s, lf]]; fr = Drop[fr, -1]]; s]]; Table[a[n], {n, 1, 89}] (* Jean-François Alcover, Nov 02 2011 *)
  • PARI
    a(n)=my(f);forstep(k=log(n*sqrt(5))\log(1.61803)+2, 2, -1, f=fibonacci(k);if(f<=n,n-=f;if(!n,return(f));k--)) \\ Charles R Greathouse IV, Nov 02 2011
    

Formula

a(n) = n if n is a Fibonacci number, else a( n - (largest Fibonacci number < n) ).
a(n) = the value of the (exactly one) digit that turns on between the Fibonacci-base representations of n-1 and n. E.g., from 6 (1001) to 7 (1010), the two's digit turns on.
a(n) = top element of the column of the Wythoff array that contains n.
a(n) = A000045(A035614(n-1) + 2). [Offsets made precise by Peter Munn, Apr 13 2021]
a(n) = A035517(n,0). - Reinhard Zumkeller, Mar 10 2013

Extensions

More terms from T. D. Noe and R. J. Mathar, May 22 2008
Showing 1-2 of 2 results.