Project Euler Q2
- Get link
- X
- Other Apps
I've recently begun to re-teach myself, to learn how to think more structurally. My goal isn't really to get to an answer but to understand why I think the way I think, so I spent some time on the 2nd question on Project Euler
Solving this with brute force was mentally frustrating, but more so because I could feel there was a faster way to do it, just not sure what that was. What was interesting was that I saw there was a sequence, every 3rd term was even. But despite knowing that, it was hard to develop some sort of formula to solve.
Heres the question:
Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:
[1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ]
By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms
If you want to try it out yourself: https://projecteuler.net/problem=2
- Get link
- X
- Other Apps
Comments
Post a Comment