Sum All Odd Fibonacci Numbers
https://www.freecodecamp.com/challenges/sum-all-odd-fibonacci-numbers
I was challenged with the problem description. From what I understood I coded it as argument as the index and not as the fibonacci value itself. So I calculated the sum of odd numbers till the fibonacci series reached an index of 1000 . I also looked up the issues and found that others have also faced similar issue.
It would be great if the description or the example given is altered to better represent the actual problem statement.
@kpbeng thanks for the feedback. Does this statement not explain well enough the problem?
As an example, passing 4 to the function should return 5 because all the odd Fibonacci numbers under 4 are 1, 1, and 3.
How do I unsubscribe from this site
On Tue, May 24, 2016, 6:31 AM kpbeng [email protected] wrote:
Sum All Odd Fibonacci Numbers
https://www.freecodecamp.com/challenges/sum-all-odd-fibonacci-numbersI was challenged with the problem description. From what I understood I
coded it as argument as the index and not as the fibonacci value itself. So
I calculated the sum of odd numbers till the fibonacci series reached an
index of 1000 . I also looked up the issues and found that others have also
faced similar issue.
It would be great if the description or the example given is altered to
better represent the actual problem statement.—
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
https://github.com/FreeCodeCamp/FreeCodeCamp/issues/8790
LiLWesT80
@lilbobz To stop receiving notifications please visit the subscriptions page and select "Not watching".
We are sorry for your inconvenience!
@kpbeng In my honest opinion, I think the description and the example provided are sufficient for my understanding. However, if others feel this could be better phrased, please let us know which specific parts are confusing or unclear. If you could provide us with an example of how you would rephrase it to improve understanding, that would help greatly. Thanks!
How about, "Return the sum of all odd Fibonacci numbers up to and including the passed number if it is a Fibonacci number." => "Given a positive integer N, return the sum of all odd Fibonacci numbers that are less than or equal to N."
You could make the example as 10. problem with 4 is its equal to index also. for eg. 1,1,2,3 Index is 4 . Whereas 10 will be 1,1,2,3,5. Here index is 5 and sum =10. Hope this helps.
@tjgerot I saw two more people raise the same issue. I understood the problem only after reading the explanation on one of the tickets. But if everyone else thinks its sufficient, I am ok...after all i did resolve the challenge!! :-)
I also had this problem. The example isn't good enough.
@kpbeng I think the example with 10 is better.
The test results are wrong. The the 20th Fibonacci number is 6765 (see https://www.wolframalpha.com/input/?i=20th+fibonacci+number). The result of sumFibs(1000) must be greater than this, yet 1785 is the expected value. The issue is that the true answers to most of the test cases are far greater than the value of MAX_SAFE_INTEGER, 9007199254740991 (the 83rd Fibonacci number by itself is larger than this).
The test values should be made much smaller
@finitism "Sum All Odd Fibonacci Numbers"
Sum all Odd Fibonacci Numbers Inside the interval. That's the secret.
Thanks for the feedback everyone. With that, I suggest it to be this:
Given a positive integer
num, return the sum of all odd Fibonacci numbers that are less than or equal tonum.The first two numbers in the Fibonacci sequence are 1 and 1. Every additional number in the sequence is the sum of the two previous numbers. The first six numbers of the Fibonacci sequence are 1, 1, 2, 3, 5 and 8.
For example,
sumFibs(10)should return10because all odd Fibonacci numbers less than10are 1, 1, 3, and 5.
To contributors, please first read the contributing guidelines before taking care of this issue. And feel free to visit the Contributors Help chat room if you have any questions about helping. We're there to help.
@erictleung I like your proposed changes to the instructions. Is this for first time contributors only or up for anyone to grab?
@BKinahan I left it as just Help Wanted, so it's up for grabs 😄