A116543 Number of terms in greedy representation of n in terms of the Lucas numbers.
0, 1, 1, 1, 1, 2, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 3, 3, 1, 2, 2, 2, 2, 3, 3, 2, 3, 3, 3, 1, 2, 2, 2, 2, 3, 3, 2, 3, 3, 3, 2, 3, 3, 3, 3, 4, 4, 1, 2, 2, 2, 2, 3, 3, 2, 3, 3, 3, 2, 3, 3, 3, 3, 4, 4, 2, 3, 3, 3, 3, 4, 4, 3, 4, 4, 4, 1, 2, 2, 2, 2, 3, 3, 2, 3, 3, 3, 2, 3, 3, 3, 3, 4, 4, 2, 3, 3, 3, 3, 4, 4, 3, 4, 4, 4, 2
Offset: 0
Examples
a(12)=2 because 12=11+1.
Links
- Clark Kimberling, Table of n, a(n) for n = 0..10000
- Ron Knott, Using the Fibonacci numbers to represent whole numbers.
Programs
-
Mathematica
s = Reverse[Sort[Table[LucasL[n - 1], {n, 1, 22}]]]; t = Map[Length[Select[Reap[FoldList[(Sow[Quotient[#1, #2]]; Mod[#1, #2]) &, #, s]][[2,1]], # > 0 &]] &, Range[1000]] (* Peter J. C. Moses, Oct 18 2012 *)
Formula
Let L(n) = max(Lucas numbers < n). Then a(0) = 0, a(n) = 1 + a(n-L(n)).
Extensions
Edited by N. J. A. Sloane, Aug 10 2007
a(0) added by Amiram Eldar, Feb 17 2022
Comments