Talk:Sexy primes: Difference between revisions
m (→possible errors in most programs: added underlining to call attention that a pair is being discussed.) |
(→possible errors in most programs: Straddling.) |
||
Line 9: | Line 9: | ||
I suggest that another task requirement would be to display the number of sexy (or unsexy) primes below '''100'''. -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 01:16, 30 September 2018 (UTC) |
I suggest that another task requirement would be to display the number of sexy (or unsexy) primes below '''100'''. -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk: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. [[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 09:30, 30 September 2018 (UTC) |
Revision as of 09:30, 30 September 2018
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)