Talk:Sexy primes

From Rosetta Code
Revision as of 01:18, 30 September 2018 by rosettacode>Gerard Schildberger (added a talk page.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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 part of a sexy prime pair   (and therefore it's 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.

Also, it isn't clear that in the above case,   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)