Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X
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?
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.
it is prime 5
Can somebody open the sheet in prime 6 with new symbolic engine?
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"
Is it correct?
@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.
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
Thanks!
I've been struggling with that!
@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
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.
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
Not sure what you mean. Your pi_gen' still uses conditional expressions which can't be evaluated symbolically.
@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
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.
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.
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
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.
Please don't post in-midst of other threads but rather open a new thread with your question!
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.
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 😉
Dear all, Please help me, how to plot many circle equation in one axis ?
Sorry - it is wrong place for your question.
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
https://community.ptc.com/t5/PTC-Mathcad/bd-p/PTCMathcad
and then click "Start a topic".
Do you know the 3d Pi-Prime number? OSID does not know!
I know only than this number has more 1000 digits.