login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A066628
a(n) = n - the largest Fibonacci number <= n.
6
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,8
LINKS
FORMULA
a(n) = n - A087172(n). - Michel Marcus, Feb 02 2016
MATHEMATICA
f[n_] := Block[{k = 1}, While[Fibonacci[k] <= n, k++ ]; Return[n - Fibonacci[k - 1]]]; Table[ f[n], {n, 0, 100} ]
PROG
(PARI) a(n) = { my(k=0); while(fibonacci(k) <= n, k++); n-fibonacci(k-1) } \\ Harry J. Smith, Mar 14 2010
CROSSREFS
Sequence in context: A049260 A273294 A053186 * A255120 A218601 A350603
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Dec 25 2001
EXTENSIONS
Corrected and extended by Robert G. Wilson v, Dec 28 2001
STATUS
approved