Python agrees.

>>> n=100;s=sum(1.0/(i*i) for i in xrange(1,n+1));(6*s)**0.5

3.1320765318091053

>>> n=1000000;s=sum(1.0/(i*i) for i in xrange(1,n+1));(6*s)**0.5

3.1415916986605099

fishfry wrote:I did this once with the series pi/4 = 1/3 - 1/5 + 1/7 - 1/9 ...

The convergence is astonishingly slow. I ran my program for days just to get 10 or 12 decimal places.

Well that's the slowest converging arctan Taylor series, so one shouldn't expect it to run quickly.

And with so many terms, you tend to get a lot of rounding error, although the alternating terms do help a bit.

If you want to calculate pi using arctan series, it's a Good Idea to use one of the

Machin-Like formulae.

FWIW, I once used arctan Taylor series and

arctan(1) = 4 * (2*arctan(1/10) - arctan(1/515)) - arctan(1/239)

to compute pi to 10 decimals, by hand.

Also see

http://turner.faculty.swau.edu/mathemat ... forms.html