Problem 2: Even Fibonacci Numbers I didn't understand this challenge

Problem 2: Even Fibonacci Numbers I didn't understand this challenge
0

#1

Tell us what’s happening:

So what I do exactly? Summing all even numbers below the provided number or what? Because that doesn’t seem the case since even numbers below 10 is definitely not 188

Your code so far


function fiboEvenSum(number) {
  // You can do it!
  return true;
}

fiboEvenSum(10);

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0.

Link to the challenge:
https://learn.freecodecamp.org/coding-interview-prep/project-euler/problem-2-even-fibonacci-numbers


#2

Can anyone tell me what I do this challenge? I really don’t understand it.


#3

The Fibonacci numbers not only numbers. I did not so far , but I think You must doing a sum Fibonacci seqeunce from even numbers.
in the example are 1, 2, 3, 5, 8, 13, 21, 34, 55, 89 , number 34 are odd and the 1 special 229-35 =188


#4

I really didn’t understand what do you mean. Do you mean that I have to sum all even numbers?

But that still doesn’t explain how the provided number can do anything here.


#5

First create Fibb numbers 1, 2, 3, 5, 8, 13, 21, 34, 55, 89 as array [] wit for loop
second loop array and x%2===0 test even number to add to the sum
return sum of even numbers


#6

What the heck!! You spoiled the whole solution. I didn’t want this.


#7

it’s not so easy there many small step


#8

I didn’t want you to tell me the solution. I just wanted to know what I have to do this challenge. I didn’t understand what is the point of this challenge.


#9

Just try it’s not easy as it’s looks like now.


#10

Dude.

I. Want. To. Know. What. Is. The. Point. Of. This. Challenge

I. Don’t. Understand. The. Goal. Of. This. Challenge.


#11

sorry I have one mistake eight is also odd


#12

You still didn’t answer my question though.


#13

Dude…chill down.

Ludodrinka is trying to help.
What is the purpose of this challenge? Maybe follow instructions? Read & understand instructions?
“Even numbers below 10 is definitely not 188”, well, that is not the request: “first 10 terms”. Maybe that will help?
Sometimes solutions are much easier than expected.


#14

But this challenge cannot be completed with instructions of 4 mil. I am not convince it should be even I send you code.


#15

Lubodrinka,
Your code works fine !
THe 4 million restrictions is for a value on the fibonacci value, because you would have an overflow…but your code is correct !


#16

@lubodrinka I’m sorry for the rudeness before. I apologise and thank you for trying to help me!

@eday69 Thank you for the help! It was useful.


#17

I still not pass numbers 18 and 31

Your function is not returning the correct result using our tests values.

here is ouput from chrome
10
VM75:23 1,1,2,3,5,8,13,21,34,55,89
VM75:7 23
VM75:23 1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181,6765,10946,17711,28657,46368
VM75:7 43
VM75:23 1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181,6765,10946,17711,28657,46368,75025,121393,196418,317811,514229,832040,1346269,2178309,3524578,5702887,9227465,14930352,24157817,39088169,63245986,102334155,165580141,267914296,433494437,701408733
VM75:7 18
VM75:23 1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181
VM75:7 31
VM75:23 1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181,6765,10946,17711,28657,46368,75025,121393,196418,317811,514229,832040,1346269,2178309


#18

@lubodrinka Yes it is, but are you adding the EVEN values?
For 10: 2+8+34+144 = 188

I think the issue is that you are considering # 1 twice…(I know, it is part of the fibonacci sequence).


#19

Assuming you know what Fibonacci sequence is by now, fiboEvenSum(n) computes nth sequence of fib, then sums all the even number within that sequence.

For example, fib(6) => [1, 1, 2, 3, 5, 8] i.e) returns the sequence of first 6 Fibonacci numbers.
Since 2 and 8 are the only even number, fiboEvenSum(6) returns the sum 10.


#20

I don’t think the instructions are clear at all and possibly wrong. If someone sees an error in my thinking please chime in.

fiboEvenSum(10) should return 188.

What is significance of the parameter?
In the case of 10 are we only to consider the first 10 Fibonacci numbers? The first 10 even Fibonacci numbers?

Assuming that this means the first ten in the series there are still some issues

By starting with 1 and 2, the first 10 terms will be: 1, 2, 3, 5, 8, 13, 21, 34, 55, 89

Most accepted series start with 0 and include two 1’s - 0,1,1,2,3,5,8…

Even using the provided definition of Fibonacci numbers that starts with one there are issues. Taking that definition of the first 10 in the series I only see three even numbers - 2, 8, 34 summing to 44. It is not until the 11th number in the series, 144, that the sum of evens would be 188.