We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
It's not perfect. When k = 12, n = 7. However, the n-th term for F is 13. We can check agaisnt this quickly with the same formula going forwards and backwards ONCE. instead of over a loop like everyone has been doing.
I should mention the relationship I gues. F_0 = 0, E = F_{3n}
I should mention, all this is useless past a certain point on a computer since percision is slowly lost. However, NASA has a great article on how accurate pi needs to be.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Join us
Create a HackerRank account
Be part of a 26 million-strong community of developers
Please signup or login in order to view this challenge
Project Euler #2: Even Fibonacci numbers
You are viewing a single comment's thread. Return to all comments →
Your post was the most helpful.
I'm just wondering why no one has posted an ACTUAL answer to this problem in over 4 years.
Which means
is the solution to it. Now the trick is to find a fast way to compute what n might actually be .
Fibonacci_index
It's not perfect. When k = 12, n = 7. However, the n-th term for F is 13. We can check agaisnt this quickly with the same formula going forwards and backwards ONCE. instead of over a loop like everyone has been doing.
I should mention the relationship I gues. F_0 = 0, E = F_{3n}
I should mention, all this is useless past a certain point on a computer since percision is slowly lost. However, NASA has a great article on how accurate pi needs to be.