We set the function f(n) (n is a positive integer) to be the number of different combinations of numbers from the above series to sum up to the n, for example:
f(11) = 3 because there are 3 ways you can make 11:
1 + 2 + 3 + 5 = 11
1 + 2 + 8 = 11
3 + 8 = 11
(you cannot use the same number twice)
Now let's set s(n) = f(1) f(2) + f(3) + ... + f(n), what is s(1017)?
I'll admit I got this as homework but I have a coding competition to attend and a holiday next week so I might not get time to try to solve it...
Question
Guest
Given the following Fibonacci sequence:
1 2 3 5 8 13 21 34 55 89
We set the function f(n) (n is a positive integer) to be the number of different combinations of numbers from the above series to sum up to the n, for example:
f(11) = 3 because there are 3 ways you can make 11:
1 + 2 + 3 + 5 = 11
1 + 2 + 8 = 11
3 + 8 = 11
(you cannot use the same number twice)
Now let's set s(n) = f(1) f(2) + f(3) + ... + f(n), what is s(1017)?
I'll admit I got this as homework but I have a coding competition to attend and a holiday next week so I might not get time to try to solve it...
Link to comment
Share on other sites
26 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.