ChudnPi/Stephan
ChudnPi/disfavour
f1from decimal import *f1from decimal import *
22
33
4def factorial(n):4def factorial(n):
n5    x = 1n5    sum = 1
6    for i in range(2, n + 1):6    for i in range(2, n + 1):
n7        x *= in7        sum *= i
8    return x8    return sum
99
1010
11getcontext().prec = 1000011getcontext().prec = 10000
1212
1313
14def PiGen():14def PiGen():
15    z = 426880 * Decimal("10005").sqrt()15    z = 426880 * Decimal("10005").sqrt()
n16    y = 0n16    k = 0
17    x = 017    sum = 0
18    while True:18    while True:
t19        a = Decimal(str(factorial(6 * y) * (545140134 * y + 13591409)))t19        a = Decimal(str(factorial(6 * k) * (545140134 * k + 13591409)))
20        b = Decimal(str(factorial(3 * y) * factorial(y)20        b = Decimal(str(factorial(3 * k) * factorial(k)
21                        ** 3 * (-262537412640768000) ** y))21                        ** 3 * (-262537412640768000) ** k))
22        x += a/b22        sum += a / b
23        yield z / x23        yield z / sum
24        y += 124        k += 1
2525
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op