I need to calculate $\pi$ -- in base: 4, 12, 32, and 128 -- to an arbitrary number of digits. (It's for an artist friend).
I remember Taylor series and I've found miscellaneous "BBP" formulas, but so far, nothing that points to calculating the digits in arbitrary bases.
How can this be done in a practical manner?
There is a celebrated formula (perhaps BBP?) that allows you to calculate an arbitrary hexadecimal digit of the expansion of $\pi$. That takes care of bases $4,32,128$.
Now any other formula that is used to calculate $\pi$ in decimal, actually calculates $\pi$ in binary, the result being converted to decimal using the simple base-conversion algorithm. So you can use any old formula, say the arc-tangent one.
Finally, there's probably somewhere on the web an expansion of $\pi$ to zillions of binary digits. Moreover, someone probably wrote a program that converts from binary to an arbitrary base. So all you need to do is find these and plug them together.