Skip to content

Instantly share code, notes, and snippets.

@nikhilvibhav
Last active December 1, 2017 11:54
Show Gist options
  • Save nikhilvibhav/87f92185327721d422543e4adaf178b7 to your computer and use it in GitHub Desktop.
Save nikhilvibhav/87f92185327721d422543e4adaf178b7 to your computer and use it in GitHub Desktop.
import math
pi = 0
fpi = float(pi)
pi_inv = 0
fpi_inv = float(pi_inv)
# Ramanujam Formula#
for n in range(1, 10):
ram_formula = (math.factorial(4 * n) / ((4 ** n) * math.factorial(n)) ** 4) * ((1103 + 26390 * n) / (99 ** (4 * n)))
fpi_inv = fpi_inv + (math.sqrt(8) / (99 ** 2)) * ram_formula
print(fpi_inv)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment