Re: A Formula for Pi



On Jun 22, 8:48�am, r...@xxxxxxxxxxxxxx (Rob Johnson) wrote:
In article <rubrum-29BD9A.21370621062...@xxxxxxxxxxxxxxxxxxxxx>,





Michael Press <rub...@xxxxxxxxxxx> wrote:
In article
<41c3a2f3-d399-42f6-b21d-ce897b6ba...@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
Mensanator <mensana...@xxxxxxx> wrote:
On Jun 20, 2:35 pm, r...@xxxxxxxxxxxxxx (Rob Johnson) wrote:
In article <4f348778-0c41-45e4-bb51-9fcc3dca9...@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
Mensanator <mensana...@xxxxxxx> wrote:
On Jun 20, 10:57 am, Maury Barbato <mauriziobarb...@xxxxxxxx> wrote:
Jose Carlos Santos wrote:
On 20-06-2008 7:16, Maury Barbato wrote:

I found in the book "The Penguin Dictionary of
Curious and Interesting Numbers" by Wells the
following formula involving pi

(pi - 3)/4

= sum_{k=1 to infty}[(-1)^(k+1)]/[2k*(2k+1)*(2k+2)]

Is there anybody who knows a proof of this
wonderful
series?

You already got a reply. I only want to remark that
the formula is
equivalent to

pi - 3 = sum_{k = 1 to oo}(-1)^{k + 1}/(k(2k +
2k + 1)(k + 1)

= �sum_{k = 1 to oo}(-1)^{k + 1}/(1^2 +
+ 1}/(1^2 + 2^2 + ... + k^2).

Best regards,

Jose Carlos Santos

A little slip. We have

pi - 3 =
sum_{k = 1 to oo}(-1)^{k + 1}/[k(2k+ 1)(k + 1)]
= (1/6)* sum_{k = 1 to oo}(-1)^{k + 1}/(1^2 + 2^2 + ... + k^2)

It's a very very beautiful formula!

Be that as it may, how fast does it converge?
How many terms do I have to sum to get 100 decimal
place accuracy?

He never claimed that it was an efficient way to compute pi,

I didn't say he claimed it was efficient. I'm _asking_
whether or not it is efficient.

simply
that it was a beautiful formula. �

Fine. It's beautiful. No disagreemrnt there.

It is a personal opinion,

Which everyone is entitled to.

but I agree.

� � oo
� � --- � � k+1 � � � 1
� � > � (-1) � �--------------
� � --- � � � � 2k(2k+1)(2k+2)
� � k=1

� � � � oo
� � � 1 --- � � k-1 � 1 � � 2 � � �1
� � = - > � (-1) � �( -- - ---- + ---- ) � � [partial fractions]
� � � 2 --- � � � � � 2k � 2k+1 � 2k+2
� � � � k=1

� � � � � oo
� � � 1 � --- � � k �1
� � = - + > � (-1) �---- � � � � � �[collapse telescoping terms]
� � � 4 � --- � � � 2k+1
� � � � � k=1

� � � 1 � � pi
� � = - + ( -- - 1 ) � � � � � � � � � � � � � �[Gregory series]
� � � 4 � � 4

� � � pi - 3
� � = ------
� � � � 4

Being an alternating series with monotonically decreasing terms, the
error is less than 1/(8n^3) after n terms.

Some of us don't know how to do this. But given the series, I can
write a program to apply it.

But I would prefer a series that converges in ~300 terms to the
one that converges in ~10**34 terms.

How about Ramanujan's series that gets eight decimal places for each term?

1 � �2.sqrt{2} � � � � (4n)! �[1103 + 26390n]
-- = --------- �sum_n ------- ---------------
pi � � �9801 � � � � �(n!)^4 � (4*99)^4n

Also look up Euler's (who else?) transformation for accelerating
alternating series. In essence a difference table.
Abramowitz and Stegun, 3.6.27.

<http://mathworld.wolfram.com/EulersSeriesTransformation.html>

At <http://www.whim.org/nebula/math/eulerxform.html>, there is a
rigorous proof of the Euler Series Transform.

However, if we apply the acceleration using the identity

� � --- � � j �C(m,j) � � k � � � 1
� � > � (-1) �-------- = --- ----------
� � --- � � � C(n+j,k) � k+m C(n+m,k+m)
� � �j

proven at <http://www.whim.org/nebula/math/binom.html>, we get

� � �m
� � --- � � j C(m,j)
� � > � (-1) �------
� � --- � � � 1/2+j
� � j=0

� � � �1 � � � �1
� � = --- ------------
� � � m+1 C(1/2+m,m+1)

� � � �1 � � � (m+1)!
� � = --- ---------------
� � � m+1 (1/2+m)...(1/2)

� � � � � �2^{m+1} m!
� � = ---------------------
� � � (2m+1)(2m-1)...(3)(1)

� � � 2^{2m+1} m! m!
� � = --------------
� � � � � (2m+1)!

Thus, the Euler Series Transform says

� � pi

� � � � oo
� � � � --- � � j � 1
� � = 4 > � (-1) �----
� � � � --- � � � 2j+1
� � � � j=0

� � � � �m
� � � � --- � � j � 1
� � = 2 > � (-1) �-----
� � � � --- � � � 1/2+j
� � � � j=0

� � � � oo � � � � m
� � � � --- �-m-1 --- � � j C(m,j)
� � = 2 > � 2 � � > � (-1) �------
� � � � --- � � � --- � � � 1/2+j
� � � � m=0 � � � j=0

� � � � oo
� � � � --- �-m-1 2^{2m+1} m! m!
� � = 2 > � 2 � � --------------
� � � � --- � � � � �(2m+1)!
� � � � m=0

� � � oo
� � � --- 2^{m+1} m! m!
� � = > � -------------
� � � --- � �(2m+1)!
� � � m=0

Which converges much faster than the Gregory series, better than a
ratio of 2 per term.

This was even easier to implement.

However...

pi time: 0.0 seconds
314159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664709384460955058223172535940812848111745028410270193852110555964462294895493038196442881097566593344612847564823378678316527120190914564856692346034861045432664821339360726024914127372458700660631558817488152092096282925409171536436789259036001133053054882046652138414695194151160943

pi_also terms: 1328 time: 0.344000101089 seconds

314159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664709384460955058223172535940812848111745028410270193852110555964462294895493038196442881097566593344612847564823378678316527120190914564856692346034861045432664821339360726024914127372458700660631558817488152092096282925409171536436789259036001133053054882046652138414695194151160942

pi == pi_also: True

arctan(1/5) terms: 287 arctan(1/239) terms: 85 time:
0.0780000686646 seconds

314159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664709384460955058223172535940812848111745028410270193852110555964462294895493038196442881097566593344612847564823378678316527120190914564856692346034861045432664821339360726024914127372458700660631558817488152092096282925409171536436789259036001133053054882046652138414695194151160943

pi == pi_Machin: True

Euler terms: 1329 time: 3.0 seconds

314159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664709384460955058223172535940812848111745028410270193852110555964462294895493038196442881097566593344612847564823378678316527120190914564856692346034861045432664821339360726024914127372458700660631558817488152092096282925409171536436789259036001133053054882046652138414695194151160942

pi == pi_euler: True

It took just about as many terms as my original formula
and is much slower to calculate. And my original can't
hold a candle to the Machin formula.

Thanks anyway.


Rob Johnson <r...@xxxxxxxxxxxxxx>
take out the trash before replying
to view any ASCII art, display article in a monospaced font
.