Twin Primes and Extracting.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Twin Primes and Extracting.
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.
- Labels:
-
Other
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Sorry Loi I still don't understand.
t might just be me, but I can't see any logic.
Mike
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Am I right in assuming this has nothing to do with Prime numbers?
I will create another thread.
Mike
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Have a look at this thread. You query has been answered there.
http://communities.ptc.com/message/156236#156236
Mike
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Its not clear exactly what your after. Have a look at the attached picture. This is what the previous function i posted returns.
Mike
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I agree with you, Mike. Or :
(The attached save as to .mcd11.)
Loi.
Message was edited by: Loi Le
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Just for it is less complicated.
Regards,
Loi.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Like the attached?
I have rushed it a little as I'm on my way out - It's Saturday night
Cheers
Mike
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I'm sure it can be programmed, but I currently don't have Mathcad.
I will have a look tomorrow.
Mike
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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!).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Here is a worksheet you might be intrested in. Found in the old collab posted by Jean.
Mike
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I have still one more extra question and wish to learn.
Thanks in advance.
Loi.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
This is the function I proposed.
Mike
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I have a concerned question with the above, and wish to learn :
Thanks in advance.
Loi.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Like the attached?
Mike
Message was edited by: Mike Armstrong - Worksheet saved down. The pre-defined function used is in the collasped area.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
My MC12 cannot open the attached. Please "save as" the attached to .MCD11 or .MCD12.
Thanks again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Many thanks, Mike.
Loi.
