Last active
March 17, 2016 09:45
-
-
Save mame-n/39837f76c4ce4b67b2a4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def root2_series | |
(1..1000).inject( [3/2r] ) do |result, i| | |
result << 1 + 1 / (result.last + 1) | |
end | |
end | |
def bigger_numerators | |
root2_series.select do |term| | |
term.numerator.to_s.size > term.denominator.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