Talk:Sexy primes

From Rosetta Code
Revision as of 12:47, 3 October 2018 by rosettacode>Paddy3118 (Limiting...)

possible errors in most programs

The task's author used   1,000,000   as a test case upper limit.

However, if he had chosen   100,   most computer programs would give an erroneous number of   unsafe   primes,   as   97   is a sexy prime.   Most computer programs only check up to   N.   As of this writing, only REXX checks for sexy primes up to   N + 6,   and carefully programs not to list sexy primes over the upper limit   (but still finds but not displays the upper half of sexy prime pairs if it exceeds the upper limit).

Also, it isn't clear that in the case of   100   being the upper limit,   should   97   be listed as the 1st half of a sexy prime pair if the top part of the pair is above the upper limit?

Now, it so happens that the next six numbers after   1,000,000   are all composite,   so all the program results are correct, even if they lucked out.   However, for the general case,   100   would be a good additional test case to count the number of sexy primes   (or unsexy primes).   Computer programs should behave correctly with a different upper limit.

I suggest that another task requirement would be to display the number of sexy   (or unsexy)   primes below   100.     -- Gerard Schildberger (talk) 01:16, 30 September 2018 (UTC)

I don't read it that way , as it mentions group and 97 is grouped with 103 and so straddles the limit. Paddy3118 (talk) 09:30, 30 September 2018 (UTC)
Hmm. Fair point, in part at least. As I see it, if the limit is 100, 97 should not be listed as a pair, even though it would be with a higher limit. It should be caught as a sexy prime though, and so should not be listed in the unsexy primes. I am somewhat disinclined to make testing at a limit of 100 an additional requirement. I would rather make the limit 1_000_035 which splits the pair 1000033,100039 and ensure that 1000033 is not listed as unsexy nor as a pair (it's sexy, but not a pair within the limit). --Thundergnat (talk) 15:38, 30 September 2018 (UTC)
Maybe say start|end of prime group is <= limit? It is pretty easy to cover either case. CraigD (talk)
My first point raised is that   97   is a sexy prime   (with a limit of 100).   Most people's attention was directed to the query about whether that   97   should/shouldn't be listed as a sexy prime pair.   My first query was that if the (a) limit was   100,   programs could easily be checked and verified that they worked (or not) regarding whether or not   97   would be listed or counted as a sexy prime   (or failing that, whether it would be listed or counted as an unsexy prime).   With a limit over   1,000,000,   it would be harder to verify   (witness that one computer program already has an incorrect count for the number of unsexy primes, but hasn't be questioned or flagged.)   Listing the sexy primes under   100   would've been a simpler way.   But, as it turns out, everybody's program's output has to be changed to handle the new limits.     -- Gerard Schildberger (talk) 23:16, 30 September 2018 (UTC)
Did I not address your query "should 97 be listed as the 1st half of a sexy prime pair?" in my second and third statements? In what way could I have made it clearer?
"Listing the sexy primes under 100 would've been a simpler way." In what way? Each relevant count is already required to be displayed. It was ambiguous about the splitting of pairs (which I clarified). I suppose there could be some confusion over whether the threshold value should be included or not, but I purposely chose a value where it didn't matter (because I wanted to test for other constraints). There is little else that is open to interpretation. If you are unable to tell that the count your entry outputs is different from all other entries, I think there are larger problems.
"everybody's program's output has to be changed to handle the new limits" Seriously? I'm sorry your chosen programming language is so difficult to run. Mine took less than a minute to modify, re-run and copy-paste the new output. Really, adding an additional required test at 100 probably also would have required you to update your output, so I fail to see why that is a hardship.
"(witness that one computer program already has an incorrect count for the number of unsexy primes, but hasn't be questioned or flagged.)" Ok, but if it was the entry I questioned and flagged (hmmm) it wasn't incorrect for any of the things you raised issue with. --Thundergnat (talk) 12:46, 1 October 2018 (UTC)
Yes, you addressed my query,   To use your words,   ... in part, at least.   At that point, there was no way to confirm if any programming entry handled the case of a straddled sexy prime pair (except for the REXX entry),   so therefore, there wasn't any way for me to verify (other than running the programs myself) if the other programs were correct, as their outputs didn't reflect whether or not sexy primes were being counted correctly for straddled sexy pair primes (since at time, none of the task's requirements encountered a straddled sexy prime pair).   I choose to instead, open a new talk section addressing this issue   (and have since regretted it, for the obvious reasons, ··· no good turn goes unpunished ··· or unharangued).   Any-a-whose, trodding on ...       At that time, you   would rather make ...   changes to the requirements, but you had not yet done so,   so it appeared to me that you didn't want to address this issue directly or at that time.   That issue is now moot as the updated task requirements have included a straddled sexy prime pair, so I am assuming that you changed the task's requirements to ensure/verify their correctness (program logic) regarding this issue.   I am now regretting even bringing up the problem, the next time I just may let sleeping dogs lie.   All this for merely exposing a potential/possible problem,   which apparently, as it turns out, there was a problem.     -- Gerard Schildberger (talk) 00:05, 2 October 2018 (UTC)
It would've been simpler in that all the unsexy primes (under 100) could've been listed (counts would've shown a problem, but I think most programmers would've like to know what exactly which primes were being counted incorrectly, or not being included or included incorrectly), and programmers could see then if   97   was or wasn't listed (as I'm assuming that would be the problematic prime).   I don't know where you got the idea that I was unable to tell that my count was different from all the others.   I was, obviously, able to tell the difference, as that was the main reason that I created this discussion page section entry.   My entry's output was different from only one other entry (the one that I was referring to).   At that time, mine only agreed with two other entries, with another entry which didn't list the number of unsexy primes at that time   (however, the count has since been added).   Please don't put on me that there are larger problems (supposedly because I can't tell the difference, because, it must be obvious that I can tell the difference,   since I created this section on the discussion/talk page).   If you don't whether that I can or can't, then you can just ask instead of assuming that I can't (all evidence to the contrary).   Rosetta Code isn't a place for ad hominem attacks (or even snide suggestions, no matter how phrased).     -- Gerard Schildberger (talk) 00:05, 2 October 2018 (UTC)
Again, you're assuming that it was (or would be) a hardship.   I never mentioned anything or implied that there was/is a hardship.   So there is no need to fail to see why there would be a hardship   ···   if there is no hardship.   Sooooo, no need to be sorry for any non-hardship.   Furthermore, the additional requirement that I suggested could've been added as an optional requirement, thus not necessitating a change if one didn't want to list all (three) unsexy primes below 100.     -- Gerard Schildberger (talk) 00:05, 2 October 2018 (UTC)
Since the entry that you flagged wasn't the entry that I noticed was different (and possibly thought was incorrect, but not for certain at that time),   and you thought that I was talking about the entry you flagged (which it wasn't), so you're saying that it wasn't correct for the points that I raised.   Well, yes, I wasn't even talking about the entry that you flagged, but another entry, so yes, we are talking about two different entries.   So therefore, my points that I mentioned don't even apply to the entry you're referring to.   Also, I don't know where you got the impression that it is so difficult to re-run my chosen programming language.   You're again making an assumption (well, actually two assumptions).   There is no reason for you to be sorry for something that isn't true.   Also, I don't know why you assumed it was a hardship.   That was and is not the case.   So your failure to see why it was a hardship also isn't a failure, as there wasn't any hardship.   Now, for the entry you questioned and flagged.   Again, it was not that programming entry that I had noticed that appeared to be incorrect (I was waiting for more programming entries to show their output which would've hopefully clarified the issue).   As it turned out, it was later changed/corrected (without it being flagged).   But, you were wrong, as you assumed that it was the entry (the one that you flagged) that I was referring to, it was different entry.   So I rather resent the fact that I found (as it turned out) an incorrect output, and you thought that I meant another incorrect output, and you further assumed that it wasn't for any of the reasons that I raised.   Oy!     -- Gerard Schildberger (talk) 00:05, 2 October 2018 (UTC)
"At that time, you would rather make ... changes to the requirements, but you had not yet done so, so it appeared to me that you didn't want to address this issue directly or at that time." Let's just check the edit history, shall we? Time when I made that comment: 15:38, 30 September 2018. Time when I made the changes to the task requirements: 15:46, 30 September 2018. Elapsed time: 8 minutes. Personally, I don't think that was too unreasonable but you are entitled to your opinion.
"In response to your entire second and third paragraphs" Not gonna quote the whole things... You made slightly ridiculous claims so I made slightly ridiculous replies. Humor doesn't come across very well in text. However, I do think you complain an awful lot about crap that doesn't much matter. (My own personal opinion, not necessarily shared by anyone else.) Nothing personal. You're obviously an intelligent person and care about the quality of the site, but the way you go about expressing it I find particularly grating. (And it's quite possible likely that I'm just an a**hole. Meh, I'll manage to live with it.)
"So I rather resent the fact that I found (as it turned out) an incorrect output, and you thought that I meant another incorrect output" Make me play guessing games and then get all bent when I guess? Ok. Resent away. --Thundergnat (talk) 11:46, 2 October 2018 (UTC)
Why not simply define:
SP pairs as n such that n<1000035 and n is prime and n-6 is prime
SP triplets as n is a member of the set of SP pairs and n-12 is prime
SP quadruplets as n is a member of the set of SP triplets and n-18 is prime
SP quintuplets as n is a member of the set of SP quadruplets and n-24 is prime
Unsexy primes as n<1000035 and n is prime and n-6 is not prime and n+6 is not prime
--Nigel Galloway (talk) 12:54, 2 October 2018 (UTC)
I too don't like the idea of needing to look beyond the given "limit" to check sexiness. When is a limit not a limit? When you are forced to look beyond it. Paddy3118 (talk) 12:47, 3 October 2018 (UTC)