Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math;
- n = int(input("Iterations: "));
- summ = 0;
- i = 0;
- while (i <= n):
- 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));
- i = i+1;
- pi = 1/(12*summ);
- print(pi);
Advertisement
Add Comment
Please, Sign In to add comment