Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
15 lines (12 sloc) 252 Bytes
def generate_sequence()
sequence = []
previous = 1
current = 2
while current < 4000000
sequence << current if current.even?
current += previous
previous = current - previous
end
sequence
end
puts generate_sequence.inject(:+)