cancel
Showing results for
Did you mean:
cancel
Showing results for
Did you mean:

Highlighted
Emerald V

Pi and Prime numbers

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?

30 REPLIES 30
Highlighted

Re: Pi and Prime numbers

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?

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.

Highlighted

Re: Pi and Prime numbers

it is prime 5

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

Highlighted

Re: Pi and Prime numbers

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"

Highlighted

Is it correct?

Highlighted

Re: Pi and Prime numbers

@ValeryOchkov wrote:

Is it correct?

Correct in which sense? If there is another prime starting with 159... then it would have more than 250 digits.

It doesn't help to let s going beyond 250 - it just takes up more time.

EDIT: Wrong, as Stuarts program had proven below. With my routines only numbers up to about 15 digits can be found. Obviously they suffer from numeric IEEE limitations even though evaluated symbolically.

Highlighted

Re: Pi and Prime numbers

And, just because I'm bored.

Prime number finder in Express

Highlighted

Re: Pi and Prime numbers

If you need an Express prime generator good for about 1000 primes (primes up to 8999), perhaps the following may be of service ...

The "module" is standalone in the sense that you can just copy the whole text region and paste it into a worksheet (taking care to avoid any name clashes).

Cheers,

Stuart

Highlighted

Re: Pi and Prime numbers

Thanks!

I've been struggling with that!

Highlighted

Re: Pi and Prime numbers

@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

Highlighted

Re: Pi and Prime numbers

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.

Highlighted

Re: Pi and Prime numbers

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

where

piGen is unchanged but should return a numeric vector.

Cheers,

Stuart

Highlighted

Re: Pi and Prime numbers

Not sure what you mean. Your pi_gen' still uses conditional expressions which can't be evaluated symbolically.

Highlighted

Re: Pi and Prime numbers

OK. I thought it was just the head function that the symbolic processor was complaining about. I wonder if a boolean selector might work then, ...?

Stuart
Highlighted

Re: Pi and Prime numbers

@Werner_E wrote:

Not sure what you mean. Your pi_gen' still uses conditional expressions which can't be evaluated symbolically.

Hi Werner,

Having had a further look at my code, I suspect that the source of the problem is that IsEmpty tests for equality with nil, which just happens to be a single character.  I'm guessing that this is the source of the conditional problem  - I can't see how generic conditionals are going to create problems, but where there's a will there's a way.

I've poked around with my worksheet, replacing nil with some arbitrarily large negative integer (but one acceptable to the numeric processor), plus making a few other minor tweaks (eg, changing my IsPrime to prime?).  I've added in some symbolic evaluations at appropriate points.

In addition, I've created a somewhat tidier, and more concise, worksheet that also adds a couple of programmed versions of Gosper's Spigot - one returns all members of the up-to-n-digits sequence, the other returns just prime members.   Can't check on Express, of course, but, hopefully, they should be correct in principle (if not in typography!).

Cheers,

Stuart

Highlighted

e: Pi and Prime numbers

Works like a charm 😉 Its OK with the old and with the new symbolic engine alike.

The code I posted in my first answer obviously is limited to numeric IEEE precision even though its evaluated symbolically. Otherwise this 38-digit number should have been in the result list.

I tried your routine up to 1000 and no additional prime was found. Not sure it thats true or if your program at some point has its limits concerning the number of digits used by the symbolics, too.

EDIT : The reason my routine does not work for higher numbers seems to be the symbolic evaluation of the "trunc" command as seen in the picture below. The new symbolic in Prime doesn't even know the trunc command.

Highlighted

Re: e: Pi and Prime numbers

Thanks, Werner. Nice to know.

According to the OEIS, the first few terms of the sequence of n-digits for leading primes are 1, 2, 6, 38, 16208, 47577, 78073, 613373. 1000 is hardly getting going! ... sounds like an all-night, unattended run if the symbolic processor is its normal tardy self.

https://oeis.org/A060421

Cheers,

Stuart
Highlighted

Re: e: Pi and Prime numbers

Oh, it didn't come to my mind to look at OEIS.

So even if we would be willing to take the time its unsure, if the symbolics in Prime is capable of dealing with numbers with 16000+ significant digits.

Highlighted

Re: e: Pi and Prime numbers

As a variation upon a theme, I've updated the recursive version of my spigot function to a) apply a predicate to the pi segments that selects them for inclusion in the returned list (eg, IsPrime, prime?, even, odd), b) apply a function function to the pi segments (eg, factors).

I found 3 trivial sequences that don't appear to be in the OEIS - quite surprising given some of the other that are (eg, the number of factors is in the OEIS, but not the sequence of the factors).

Cheers,

Stuart

Highlighted

Re: Pi and Prime numbers

Dear Mr. Werner_E, & All friends in Mathcad Prime.

Could you explain me, how to plotting array pile as show below picture to me please ?

Thank you all friends in advance.

Highlighted

Highlighted

Re: Pi and Prime numbers

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.
Highlighted

Re: Pi and Prime numbers

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.

Highlighted

Re: Pi and Prime numbers

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.

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 😉

Highlighted

Highlighted

Re: How to plot many circle equation in one axis ?

Sorry - it is wrong place for your question.

Highlighted

Re: How to plot many circle equation in one axis ?

As Valery already said - its the wrong place here!

You asked the same question twice in midst of two threads which both have nothing to do with your question! Please avoid this for future questions.

To open a new thread with a question concerning Mathcad or Prime, go to

and then click "Start a topic".

Highlighted

Highlighted

Highlighted

Re: Pi and Prime numbers

Do you know the 3d Pi-Prime number? OSID does not know!

I know only than this number has more 1000 digits.

Announcements