Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mame-n/a1ba0d63d42f0667712c to your computer and use it in GitHub Desktop.
Save mame-n/a1ba0d63d42f0667712c to your computer and use it in GitHub Desktop.
def root2_series
(1..1000).inject([[3,2]]) do |result, n|
result << [result.last[0] + 2 * result.last[1], result.last[0] + result.last[1]]
end
end
def bigger_numerators
root2_series.select do |term|
term[0].to_s.size > term[1].to_s.size
end
end
p bigger_numerators.size
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment