Skip to content

Instantly share code, notes, and snippets.

@nspool
Created January 4, 2020 22:06
Show Gist options
  • Save nspool/0fb1870e69c518def068ce4940218c4d to your computer and use it in GitHub Desktop.
Save nspool/0fb1870e69c518def068ce4940218c4d to your computer and use it in GitHub Desktop.
Euler 2
s = 0
def fib(x,y):
if y < 4000000:
if y % 2 == 0:
global s
s = s + y
v = fib(y, x + y)
return v
else:
return 0
fib(1,2)
print(s)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment