@Korkin/

euler2

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
import sys


n = 4000000
fibbonaci = [0,2]
sumEven = 0
length = len(fibbonaci)
while fibbonaci[length-1]<n:
  fibbonaci.append(4*fibbonaci[length-1]+fibbonaci[length-2])
  fibbonaci.pop()
for num in fibbonaci:
  sumEven+=num
print(sumEven)