Skip to content

Instantly share code, notes, and snippets.

@qrush
Forked from edmistond/gist:281533
Created January 20, 2010 02:29
Show Gist options
  • Save qrush/281534 to your computer and use it in GitHub Desktop.
Save qrush/281534 to your computer and use it in GitHub Desktop.
fib = [1, 2]
while fib.last < 4_000_000
fib << fib[-1] + fib[-2]
end
fib.each do |f|
puts f if f % 2 == 0
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment