1. Steve McConville
  2. Project Euler

Commits

Steve McConville  committed a7b20a4

solved 2 with python & OEIS

  • Participants
  • Parent commits 7de20be
  • Branches default

Comments (0)

Files changed (1)

File 2/solution.py

View file
  • Ignore whitespace
+def euler2():
+    # https://oeis.org/A000045
+    fib_under_4m = [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946, 17711, 28657, 46368, 75025, 121393, 196418, 317811, 514229, 832040, 1346269, 2178309, 3524578]
+
+    return sum(filter(lambda x: (not x%2), fib_under_4m))