Guest User

Chudnovsky

a guest
Feb 5th, 2016
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.27 KB | None | 0 0
  1. import math;
  2. n = int(input("Iterations: "));
  3. summ = 0;
  4. i = 0;
  5. while (i <= n):
  6.     summ = summ + (pow(-1,i)*math.factorial((6*i))*(545140134*i+13591409))/(math.factorial(3*i)*pow(math.factorial(i),3)*pow(pow(640320,3),i+0.5));
  7.     i = i+1;
  8. pi = 1/(12*summ);
  9. print(pi);
Advertisement
Add Comment
Please, Sign In to add comment