A254123 Least number of terms needed to build n from Fibonacci numbers using + and *.
1, 1, 1, 2, 1, 2, 2, 1, 2, 2, 2, 3, 1, 2, 2, 2, 3, 2, 3, 3, 1, 2, 2, 2, 2, 2, 3, 3, 2, 3, 3, 3, 3, 1, 2, 2, 2, 3, 2, 2, 3, 2, 3, 3, 3, 3, 2, 3, 3, 3, 4, 3, 3, 3, 1, 2, 2, 2, 3, 2, 3, 3, 2, 2, 2, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 4, 4, 3, 3, 3, 3, 3, 1, 2, 2, 2
Offset: 1
Keywords
Examples
a(40) = 2 because 40 = 5*8; 5 and 8 are Fibonacci numbers but 40 is not.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
Maple
N:= 1000: # to get a(1) to a(N) A:= Vector(N): for i from 1 do f:= combinat:-fibonacci(i); if f > N then break fi; A[f]:= 1 od: for n from 1 to N do if A[n] = 0 then m:= floor(n/2); r:= min(A[1..m] + A[[seq(n-i,i=1..m)]]); for a in select(`<=`, numtheory:-divisors(n) minus {1}, floor(sqrt(n))) do r:= min(r, A[a] + A[n/a]) od: A[n]:= r; fi od: seq(A[i],i=1..N);
Comments