Calculate $\pi$ in an arbitrary base, to arbitrary precision 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?
 A: 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.
A: There are many algorithms that can calculate pi, or alternatively there are many sufficiently accurate approximates of pi (to what might as well be arbitrarily many decimal places). I think the easiest way would just be to take the known value and covert it with a method of base conversion, rather than calculate it independently in each.
A: Usually, ye calculate pi, and then convert it into the target base.  
   3:16E8 E212,7796 7998,5967 5292,6847 6661,9725 5723         base 120
   3.141 592 653,589 793 238,462 643 383,279 502 884,197       base 10

This is an implementation in rexx, that finds pi to so many digits in decimal, base 120, and any named base.
