Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X
Hi,
I have a question and need help. Assuming that we have a set of Prime Numbers (from 5 to 37
in this case) Let's extract Twin Primes like as the Output below. (IN .MCD12)
Thanks in advance.
Regards,
Loi.
Solved! Go to Solution.
Mike,
I am not sure how to say it. Probably it is about "Inner match". In other words:
or :
Sorry about my English.
Thanks in advance.
Loi.
Sorry Loi I still don't understand.
t might just be me, but I can't see any logic.
Mike
Am I right in assuming this has nothing to do with Prime numbers?
I will create another thread.
Mike
Have a look at this thread. You query has been answered there.
http://communities.ptc.com/message/156236#156236
Mike
I have a related question with the above, and I am very interested in, wish to learn, and need help. ( IN .MCD12 ). Assuming that we have a set of Prime Numbers (from 17 to 103), extract All of Elements and NON-OVERLAP include :Triplet, Twin, Cousin Primes like as the Output below. (or the Output is a similar one).
Thank you in advance.
Regards,
Loi.
Loi,
This thread isn't getting very complicated and even harder to trace.
I will create a new thread with this solution. This will enable collabs to comment and improve the functions posted.
Mike
Its not clear exactly what your after. Have a look at the attached picture. This is what the previous function i posted returns.
Mike
I agree with you, Mike. Or :
(The attached save as to .mcd11.)
Loi.
Message was edited by: Loi Le
I know what your after sorry.
I think I can program that. If you don't mind me asking why exactly would you want to exclude overlaps?
Mike
Just for it is less complicated.
Regards,
Loi.
Sorry for taking so long to come back to you, been mad busy.
Your new function request makes no sense. In your image you are requesting No. 41 to be returned in a Triplet prime, but it first appears at the start of vector P and is a Twin Prime with No.43.
What rule are you proposing to dictate that No.41 & 43 don't be returned as Twin Primes?
Mike
I have a related question with the above, I am very interested in, wish learning, and need help. ( IN .MCD11 ). Assuming that having a Nested Array A, Sorting A according to Scalar, like as the Output below. (or the Output is a similar one).
The attached below. (from .mcd12 save as to .mcd11).
Thank you in advance.
Regards,
Loi.
Like the attached?
I have rushed it a little as I'm on my way out - It's Saturday night
Cheers
Mike
I really appreciate your responses, are betimes, Mike.
After being helped from the above, I hope I could write the following function
someday.
Thanks again to all of your time and help.
Regards,
Loi.
I'm sure it can be programmed, but I currently don't have Mathcad.
I will have a look tomorrow.
Mike
Sorry, but that's not correct. Twin primes are pairs of primes that differ by 2, so (23,29) is not a valid pair.
Ooops. Of course not.
Didn't even read the question properly. Just concentrated on nesting every two elements.
Mike
Richard,
Its such a shame that I don't agree with removing posts because this is a valid example of a post needing to be removed.
Mike
Unfortunately, unless they have fixed it so you can delete only your own post and not all the ones subsequent to it, that would delete most of the thread (including Staurt's answer!).
Unfortunately, unless they have fixed it so you can delete only your own post and not all the ones subsequent to it, that would delete most of the thread (including Staurt's answer!).
Think I'll pass on that then.
Mike
Here is a worksheet you might be intrested in. Found in the old collab posted by Jean.
Mike
I have still one more extra question and wish to learn.
Thanks in advance.
Loi.
Like the attached?
Just a word of advice. If somebody posts an answer to the original question don't ask another question and discard the answer. You have asked a question which is a variation to the original thread and created a new Mathcad document without the function supplied by Richard or Stuart.
If you keep all posted functions in the worksheet, all collabs can track the progress of the thread by downloading the latest file.
Mike
Loi Le wrote:
I have still one more extra question and wish to learn.
Thanks in advance.
Loi.
Looks straightforward. Refer to my previous example, add a new variable MTP (merged twin primes), every time you add an item to TP or NTP, add it to MTP. At the end, add MTP to the augment.
Stuart
(I haven't got Mathcad open at the moment (installing something else), so I'm just guessing from what I remember of my function ... sounds OKish, though)
This is the function I proposed.
Mike
I have a concerned question with the above, and wish to learn :
Thanks in advance.
Loi.
Like the attached?
Mike
Message was edited by: Mike Armstrong - Worksheet saved down. The pre-defined function used is in the collasped area.
My MC12 cannot open the attached. Please "save as" the attached to .MCD11 or .MCD12.
Thanks again.
Many thanks, Mike.
Loi.