Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/k-s-a/euler_fib_even_sum
https://github.com/k-s-a/euler_fib_even_sum
Last synced: 5 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/k-s-a/euler_fib_even_sum
- Owner: K-S-A
- Created: 2017-08-17T09:33:27.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-08-17T10:43:41.000Z (over 7 years ago)
- Last Synced: 2024-12-29T13:25:53.319Z (10 days ago)
- Language: Go
- Size: 574 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Even Fibonacci numbers ([link](https://projecteuler.net/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.## Use
Type in console:
```
% ./bin/fib 4000000
Sum of all even Fibonacci numbers, that less than 4000000 is 4613732.
% ./bin/fib 999999999
Sum of all even Fibonacci numbers, that less than 999999999 is 350704366.
% ./bin/fib 999999999999
Sum of all even Fibonacci numbers, that less than 999999999999 is 478361013020.
```## Build
`% go install fib`
## Tests
```
% go test
ok fib 0.006s
```