Last active
March 14, 2022 08:09
-
-
Save BonyChops/55f3e3234fabc3de4c21dd84714c3216 to your computer and use it in GitHub Desktop.
1kpi-ruby
This file contains hidden or 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
require 'bigdecimal/util' | |
sum = 0 | |
2090.times do |i| | |
t = (10 ** 1000) / ((2 * i + 1)* (3 ** (i + 1))) | |
sum += t if i % 2 == 0 | |
sum -= t if i % 2 == 1 | |
end | |
sum *= 6 | |
sum *= Integer.sqrt(3 * (10 ** 1000) ** 2) | |
puts sum |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment