Re: A Formula for Pi



In article <2e23fae6-a30d-49d8-9520-62d16cecc0b8@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
Mensanator <mensanator@xxxxxxx> wrote:
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.

Did you take advantage of the fact that the ratio of one term to the
next is m/(2m+1). That makes it a snap to implement:

1 1 2 1 2 3 1 2 3 4
pi = 2 ( 1 + - + - - + - - - + - - - - + ... )
3 3 5 3 5 7 3 5 7 9

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.

I hope you did not use the factorial function in your implementation,
but used the term to term ratio I pointed out above. If so, it should
be a little over

I wasn't trying to get the quickest converging series, I was trying
to show that Euler Series Accleration can take a terribly slowly
converging series, like the Gregory Series, and make it into a
fairly quickly converging series.

The series that I accelerated from the Gregory series has only a
term to term ratio of about 2, which yields about .3 digits per term
(about 1335 terms for 402 digits).

The arccot(5) part of the Machin formula has a ratio of about 25, and
yields about 1.4 digits per term; the arccot(239) part has a ratio of
about 57121, and yields more than 4.75 digits per term. This comes
out to about 1.08 digit per term altogether (about 372 terms for 402
digits).

The quickest converging Machin-like series I have seen is Gauss's

pi = 48 arccot(18) + 32 arccot(57) - 20 arccot(239)

which yields about 1.12 digits per term altogether (about 359 terms
for 402 digits). However, I just looked up on MathWorld, and there
it has

pi = 732 arccot(239) + 128 arccot(1023) - 272 arccot(5832)

+ 48 arccot(110443) -48 arccot(4841182) - 400 arccot(6826318)

which comes in at over 1.51 digits per term.

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



Relevant Pages

  • Re: A Formula for Pi
    ... Did you take advantage of the fact that the ratio of one term to the ... I wasn't trying to get the quickest converging series, ... term to term ratio of about 2, which yields about .3 digits per term ...
    (sci.math)
  • Re: A Formula for Pi
    ... Did you take advantage of the fact that the ratio of one term to the ... I wasn't trying to get the quickest converging series, ... term to term ratio of about 2, which yields about .3 digits per term ...
    (sci.math)
  • Re: A benchmark comparing ECM and triangle number factoring.
    ... digits each with their ratio close to but less than. ... Nowadays, ECM can. ... in the universe and that grain of sand if found would be ...
    (sci.math)
  • Re: Q: About number of primes with n digits?
    ... The next 21 primes are 2 digits in length. ... Sequence is in OEIS as A006879. ... Will the ratio between terms converge? ...
    (sci.math)
  • Re: Counting taxicabs...
    ... decimal notation, and thus contain no digits at all. ... x^y, where x and y are both rational numbers, yields more irrational ... infinity more quickly than the set of rational numbers does, ...
    (rec.puzzles)