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.

A066628 a(n) = n - the largest Fibonacci number <= n.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30
Offset: 0

Views

Author

Amarnath Murthy, Dec 25 2001

Keywords

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{k = 1}, While[Fibonacci[k] <= n, k++ ]; Return[n - Fibonacci[k - 1]]]; Table[ f[n], {n, 0, 100} ]
  • PARI
    a(n) = { my(k=0); while(fibonacci(k) <= n, k++); n-fibonacci(k-1) } \\ Harry J. Smith, Mar 14 2010

Formula

a(n) = n - A087172(n). - Michel Marcus, Feb 02 2016

Extensions

Corrected and extended by Robert G. Wilson v, Dec 28 2001