Skip to content

Instantly share code, notes, and snippets.

@kpassapk
Created September 26, 2012 21:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kpassapk/3790722 to your computer and use it in GitHub Desktop.
Save kpassapk/3790722 to your computer and use it in GitHub Desktop.
Euler2 Slightly Less Naive
MAX = 1e7
f0 = 1
f1 = 2
sum = 2
begin
f = f0 + f1
f0 = f1
f1 = f
break if f > MAX
if f % 2 == 0
sum = sum + f
end
end while true
puts sum
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment