zengin / project-euler-solutions

Solutions to Project Euler problems in Go
http://project-euler-answers-in-go.blogspot.com/
Other
5 stars 2 forks source link

Error in problem 2 #1

Open olivier-grech opened 7 years ago

olivier-grech commented 7 years ago

I believe there's an issue in problem 2. The answer should be 4613733 and not 4613732.

I think the error comes from the fact that you forgot to add the very first term (1) of the Fibonacci numbers to your sum.

zengin commented 7 years ago

Thanks for the comment Olivier.

It's been years since I wrote these exercises, but I remember tweaking the results so that projecteuler site would accept it.

You are right. Fibonacci starts with either 0, 1 or 1, 1, which both result in the same answer for this question. There is controversy between 0, 1 and 1, 1, but 1, 2 is clearly in the middle of the sequence and wrong. Projecteuler site should also correct their answers.

Feel free to send a pull request :)