https://github.com/max-fitzpatrick/eulerpb2
https://github.com/max-fitzpatrick/eulerpb2
project-euler python
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/max-fitzpatrick/eulerpb2
- Owner: max-fitzpatrick
- Created: 2017-05-18T23:04:04.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-05-18T23:07:04.000Z (over 8 years ago)
- Last Synced: 2025-05-14T11:23:25.977Z (8 months ago)
- Topics: project-euler, python
- Language: Python
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# EULERPB2
ORIGINAL QUESTION (Euler project, problem 2):
"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."
This code is a generalized solution to this problem. Instead of using 4000000 as a static max value and instead of only summing even numbers, the program allows you to specify your own maximum value and allows you to choose between summing even/odd/all numbers of the sequence.