For interest's sake, I'm writing a Python script that calculates $\pi$ using a spigot method (outlined in detail here).
However, I'm interested in trying to start from the middle -- maybe I can run multiple scripts simultaneously? Here's the formula:
q,r,t,j = 1,180,60,2
while True: #infinite loop, on purpose.
u,y = 3*(3*j+1)*(3*j+2), (q*(27*j-12)+5*r)//(5*t) #// means integer division (truncates)
yield y #next digit of pi
q,r,t,j = 10*q*j*(2*j-1), 10*u*(q*(5*j-2)+r-y*t), t*u, j+1
I think if I could calculate the value of q, r, t, and j at a given spot, I could just input those. However, I can't think of a way to do that. Can it be done?
Edit: t here seems to be (3n)!/(3!n!), and j seems to be n so far. Also, floor(r/t) seems to be the digits of pi. Maybe that was obvious, but it seemed cool to me.