Skip to main content
24-Ruby IV
July 13, 2020
Question

Pi and Prime numbers

  • July 13, 2020
  • 4 replies
  • 12078 views

1)

I know four Prime numbers from Pi without point.

Pi-Prime.png

Do you know more?

2) How we can find this numbers not manual - by programming?

3) It the problem correct and solved?

4 replies

25-Diamond I
July 13, 2020

Your last number is only correct if you use rounded numbers. The last 9 is not a digit of pi.

I guess Mathcads symbolics will not allow us to find more of that kind of numbers. The float command is limited to 250 significant digits (which also means that I should have used 249 instead of 251 😉

You'll have to use a more capable program for further investigation, maybe good old Derive could be of help as there the number of digits is limited only by available memory (but being rather old I suspect it will not be able to use more than 1 GB). How about the abilities of Maple?

Werner_E_0-1594650788555.png

Remark: As Stuart has show with his attempts below, those routines will only provide numeric IEEE precision. So only numbers up to 15 significant digits can be found, no matter how large s is chosen.

 

24-Ruby IV
July 14, 2020

it is prime 5

Can somebody open the sheet in prime 6 with new symbolic engine?

e-prime.png

25-Diamond I
July 14, 2020

While the new symbolic engine allows values larger than 250 in the "float" modifier, it fails in the program if "s" exceeds 20 😞

The error message is "Unknown error: Integer_expected"

Werner_E_0-1594734365125.png

 

 

 

23-Emerald V
July 13, 2020

@ValeryOchkov wrote:

1)

I know four Prime numbers from Pi without point.

 

Do you know more?

2) How we can find this numbers not manual - by programming?

3) It the problem correct and solved?


I've only got Mathcad Express, so symbolics and large numbers are not directly available.   However, it is possible to generate an arbitrarily long sequence of digits for pi by using a spigot algorithm.   

 

I've had a quick play with one form of spigot and checked for primality using a basic factorization algorithm.   Unfortunately, I can only check 10 digits potential primes, so had to look up your 12-digit candidate (as Werner said, it's been rounded up by the symbolic processor from an 8 to a 9 in the last digit).

 

It would be interesting to know if the algorithm works with the symbolic processor.   It will (probably) need changing to create a list of numbers directly (rather than the string form I used for conciseness) so that the built-in IsPrime function can be used.

 

Cheers,

 

Stuart

25-Diamond I
July 14, 2020

I just gave it a quick try and the symbolic evaluation of routines like your "pi_gen" fail because of the use of the "if" command in "head" and "tail".

Redefining  p12list:=p12list= and then using the built-in Is Prime works OK, but of course the redefinition (actually already the conversion of the string to the number) limits us to the IEEE precision of the numerics.

The main problem is that "str2num" is a numeric only function and cannot be evaluated symbolically. So we are limited to 15 digits.

Werner_E_0-1594733806954.png

 

 

23-Emerald V
July 14, 2020

Thanks, Werner.  Have you tried replacing the string conversions with a multiplication?  For example,

 

2020 07 14 B.png

where

2020 07 14 C.png

 

piGen is unchanged but should return a numeric vector.

 

2020 07 14 D.png

 

Cheers,

 

Stuart

24-Ruby IV
July 15, 2020
From my future book!
Another mathematical problem that is also often used to compare computers and their software is finding large primes. This task is no longer empty fun - it has important practical applications in cryptography, for example. You can try to cross, as mathematicians put it, these two problems and find the maximum prime number of the form 314... Visitors to the site https://community.ptc.com/t5/PTC-Mathcad/Pi-and-Prime-numbers/td-p/677039 , on which the authors of this textbook posted this problem, found the first four primes forming the number π without a decimal point: 3, 31, 314159 and 31415926535897932384626433832795028841. In Figure an attempt was made to solve a modification of this problem: find the numbers π in the hidden “tail” (in the digital sequence following the well-known three digits 3.14).
The program in Figure, it was shown that within one hundred thousand characters of the number π in its "hidden" tail "there is only one prime number 104729 (3.141592653). And can you find an even greater prime number, if you go not up to a hundred thousand, but to a million, to a billion, a trillion, etc.? The question can be posed in another way: what is the largest prime number that can be found in the known set of found digits of π.
So, in the sequence of four million first digits of the number π (https://sanstv.ru/pi), the ten thousandth prime number 104729 (http://chemister.ru/Other/Text/primes10000.htm) is found only once. But there you can find another larger prime number 333667. This (the largest prime number in the sequence of digits of the number π) can be a new interesting task for testing both supercomputers and programmers who create programs for them.
Fig-3d.png
25-Diamond I
July 15, 2020

As I have written above, all numbers for "s" above 28 yield no usable results, because the symbolic evaluation of the "trunc" command yield wrongs results. So unfortunately it does not make sense to let the loop run up to 100000.
This was the reason the program I posted in my first answer did not find the 38-digit prime. With Stuarts program it was able to find that number.

The next prime number (I am only speaking of the digits of pi beginning with 314...) as can be seen in Stuarts post will have 16208 digits. According to the speed measure I did so far and depending on the model we chose for prediction, Stuarts routine wold take 5 days up to a couple of years and its not sure at all if his program with Mathcads symbolic would be able to find and display that large number.

 

25-Diamond I
July 15, 2020

Here is a replacement for "trunc" which works for higher numbers with the symbolics, too. Unlike "trunc" the routine "trunc2" has two arguments and works similar to "round" used with two arguments. The second argument is the number of decimals. I tried to create a real "trunc" replacement based on this routine, but I got the same faulty results as with the original "trunc".

But take care - "trunc2" IS FAULTY!!

If there are more than 10 nines after the last digit you want to see, it delivers a wrong result and there sure are positions in pi with more than 10 nines in a row! You can push this limit higher to 20 nines in a row, but there always will be a limit and so its not a reliable replacement.

Werner_E_2-1594846137011.png

I wasn't patient enough for the last expression to finish (the result 1 you see stem from copying and pasting the expression above and then changing the numbers. According to OEIS it should yield 1.

And if the "simple" evaluation of "IsPrime" takes so long, I guess the program with the for-loop will never in my life find that 16208-digit prime 😉

 

 

 

 

24-Ruby IV
July 17, 2020

We are searching

pi-Pr.png

My know-how!