Problems & Puzzles: Puzzles

Puzzle 50.- “The best approximation to pi with primes”

As usual, the subject was coming to me after visiting the Patrick De Geest beautiful pages. There was the following one: “Approximating pi with Palindromes”.

In that and the same place we are invited to see the Eric Weisstein's pi-pages where from the Castellano’s result was taken:

1.09999901 x 1.19999911 x 1.39999931 x 1.69999961 = 3.141592573

Then I modified a little bit the idea, and asked my self for the best approximations to pi with primes (not necessarily palprimes). I devised also a procedure (maybe a kind of arbitrary) to rank the different known approximations.

 I got some of the “best” approximations from the Weisstein pi-pages and made my own initial contribution. This is the result:

Pi and Primes

Pi = 3.1415926535898793238…

Author pi approximation (1) Digits used Result Digits OK Points (2)
Ramanujan 17*sqrt(7)/(2*2^3) 6 3.141829682 3 50.00%
Egyptians 2*11/7 4 3.142857143 2 50.00%
Stoschek 2^(3^2)/163 6 3.141104294 3 50.00%
Carlos Rivera 211891/67447 11 3.141592658 8 72.73%
Pi & Golden Ratio 3(3+sqrt(5))/5 4 3.141640786 3 75.00%
Jud McCranie 1833616417 / 583658233




Plouffe 43^(7/23) 5 3.141539853 4 80.00%
Jud McCranie See Below


See Below


Jud McCranie See Below


See Below


Gardner 3+((2^2)^2)/113 7 3.14159292 6 85.71%
Carlos Rivera See Below


See Below


Felice Russo sqrt(ln(33487/(sqrt(3))))




Ramanujan & Olds 5*71/113 6 3.14159292 6 100.00%
Carlos Rivera ln(2^3*829453)/5




Jud McCranie See below 23 See below 30 130.4%
Jean Brette
See below 15 See below 30 200.0%
Next ???         ???
Paul Leyland See below in the "Other approaches" section See below Arbitrary large Arbitrary large Arbitrary large

(1)You are able to use any mathematical operation.
(2) Points = (Digits O.K.) / (Digits used) x 100

Would you like to improve these results?


See them in red color in the table:

Carlos Rivera (23/04/99):

Inside the limit of the current Ubasic (2032 digits) and working in Point 421 mode, you can probe that: int(pi*10^547) - 3*10^547
is the larger prime contained in the decimal digits of pi (disregarding the initial "3"). So the following number of 547 digits is prime (strongpseudoprime by now):


Let's call it P(547). Obviously 3 + P(547)/(2*5)^547 produce pi with 547 correct digits, using a total of 553 digits with all the primes (it happened that 547 is prime also!) for a rank of 98.91%

This constitutes a method for improving the approximation of pi, supposed you can find and probe the primality of larger and larger primes in pi.

p.s. I would like to add that some months ago (?) my friend G.L.Honaker invited to me to look for primes in pi starting with the "3" and disregarding the "decimal period". When I started defining and making some contributions to this puzzle I didn't related that search with it. Just this morning I awake with the idea of rescuing that primes but it happens that the largest of that kind of primes is 27 digits large, and I wanted something larger (specially after the Jud's result...). Then suddenly I made the final step: to throw away the initial "3" (why not?) and started looking for primes in the decimal portion of pi, with the result that there are primes with 5, 12, 281 and 547 digits....!.So, thanks Honaker...

Jud McCranie (23/04/99) has sent other two approximations to pi using only primes:

Rank = 15/18 =83.33

Rank = 17/20 = 85.00

Felice Russo sent (28/04/99):

Formula, value, digits employed, digits OK, Rank
sqrt(ln(33487/(sqrt(3)))) = 3.
141592977847856 , 6, 6, 100 %
sqrt(ln(5351^2/1481)) = 3.
141592695171481, 9, 7, 77.8%
e^sqrt(10993/8389) = 3.
141592616712708, 9, 7, 77.8%
ln(19739/853) = 3.
141592105651308, 8, 6, 75%
e^75709/66137 = 3.
141592631719165, 10, 7, 70%

Jud McCranie has found - at last, 03/05/99- the most wanted >100% approximation to pi:

ln(2^3*3*10939058860032031)/sqrt(163) =
23 digits used and 30 digits OK.... for a 130.4% rank!!!!!!...

Have my most sincere congratulations, friend Jud....

Jean Brette has improved the Jud's result analyzing & changing the argument of the ln function. This is his amazing result:

ln[(2^5*5#*23*29)^3+739+5]/sqrt(163) = 3.14159265358979323846264338327973

which has the same
30 correct digits using only 15 digits of prime numbers for a pretty Rank of 200.00%.

Other relations between pi and prime numbers

1) Exact Relations between pi and prime numbers

Jud McCranie and Paul Leyland sent some exact relations between pi and prime numbers, based in known mathematical identities

Jud uses the known identity 4*arctan(1) = pi and produces the relation 2*2*arctan(3-2) = pi. Others are 2*arcsin(3-2) = pi and 2*arccos(2-2) = pi.

Paul uses the known identity e^(pi*i) = -1 to produce the relation pi=ln(2-3)/sqrt(2-3)

Of course, none of these relations can be used to calculate pi in any extent.

2) pi of arbitrary accuracy using only prime numbers to describe a Turing machine devoted to calculate pi

Paul Leyland
devised the following representation of
pi with arbitrary accuracy using nothing more than prime numbers:

"...However, if you don't want trig, exploit Godel numbering and Turing machines. Define a Turing machine and write a program for it to calculate
pi to arbitrary precision. This is tedious but clearly possible. The Turing machine, by definition, is a finite state machine and so can be encoded in a finite number of symbols --- use a distinct prime for each distinct symbol. Likewise, it is straightforward to write a finite program for such a machine which will output pi to an arbitrary number of places. The program can itself be encoded in a finite number of different primes, one for each distinct symbol. So far, it's been easy, but we need to encode the order in which the symbols appear. Suppose there are N symbols in total, not necessarily distinct. We start labeling the distinct symbols with successive primes starting from the (N+1)th prime. We then write the Turing machine and program as a product of powers of these primes. Everywhere symbol {i} appears, we raise it to the power of its position in the list of small primes. For all the symbols, we then accumulate the running product. The resultant product consists of nothing but primes, multiplication-symbols and exponentiation-symbols. On one interpretation, it's just a very large but finite integer. In another interpretation, it's an arbitrarily precise representation of pi. Interpretation is everything, even in the examples you give on your page"

3) pi of arbitrary accuracy using only 2 prime numbers and two distinct and nested functions

Paul Leyland
has also devised a 'formula' that produces the
pi value with arbitrary accuracy - as large as the accuracy of pi obtained with the ratio A/B of two previously known integers A & B - executing certain "mathematical operations" explicitly over only two prime numbers.

For example let's use the approximation to pi 22/7 = 2*11/7 = 3.142857 that has a Rank = 2/4*100 = 50%

The Leyland's formula for this specific approximation to pi is:


where "lg" means "log base 2" and "SSS...SSS(2)" means "square root of 2, as many times as large is the S-string".

Well, this representation of pi, that uses only two digits in primes explicitly used, has the same accuracy referred to pi than 22/7, but a Rank = 2/2*100 = 100%. According to this example it is possible to increase the Rank up to an arbitrarily large quantity.

How large can be the numerator of the quotient A/B in order to execute correctly the computation of the
Leyland's formula inside the limits of the current high-precision arithmetic packages freely available like Ubasic or PARI?


Laurent de Jerphanion From Paris, France sent (26/10/2000) the following nice & new solutions:

" is relatively easy to get solutions at 100% :

3+sin sin (3) = 3.1406520...
7*e^cos(5/2) = 3.14170778...
2 * 7/(5-e/5) = 3.14158896...

Solution at 125% :

e + e^-e^-e^(-17/(3*3)) = 3.1415956...

Solution at 133% :

3+e^-e^e^(-2/5) = 3.14158389...

Solutions at 150% :

e + tan(2/5) = 3.14107504...
3/sin(3*e) = 3.14109534...
(ln ln (97+7/5))^e = 3.141592497...

Solutions at 200% :

e^e^e^-2 = 3.1421918...
ln (e . ln (7! - 61)) = 3.1415925681...

Although the last one would be downgraded to 120% in the form:

2/2 + ln ln (7! - 61)

...not to mention ‘infinite’ solutions with no digits at all (so they contain no non-primes), such as e + sin(e) = 3.12906311... But that is stretching things a bit..."


From time in time this puzzle brings new puzzlers! Now is the turn for Polly T. Wang who sent (October 30, 2002) the following solutions:

solution at 50%: E^((2^11+2*(2^2)!)/1831)=3.1415919.....
solution at 62.5%: ln(3*5*307/199)=3.14159312.....
solution at 70%:ln(2*463*929/3)/(2^2)=3.14159267....
solution at 75%: 3+(17/5!)=3.14166666.....
solution at 125%:ln(5*10691/11#)=3.1415926539317.....


One reader just named 'Jonathan' wrote:

' ...the solution "ln(2^3*3*10939058860032031)/sqrt(163) = ..." is simply an inversion of: e^(pi*(sqrt(163))) =? that massive integer. and was known to Ramanujan. widely referenced in American literature, and appearing most notably in the April fools section on 1974 scientific American (which claimed that it had been proven to be an exact equality) so... it should be attributed to Ramanujan if anyone...'

Jud McCranie replied on my request, about this comment the following short not:

Yes, I knew it wasn't original with me. I didn't mean to imply that I originated it... I knew that fact about the close approximation to pi, I didn't discover it.


10 years later this puzzle is still interesting to new puzzlers. Arkadiusz Wesołowski wrote (July 09):

(sqrt(2+e^e)/e)^e = 3.141599009...
Rank = 500%

sqrt(2+e^e)^e/log(e^e^e) = 3.141599009...
Rank = 500%





Records   |  Conjectures  |  Problems  |  Puzzles