[seqfan] -5 is not a prime

Neil Sloane njasloane at gmail.com
Sun Jan 3 18:02:11 CET 2021


Amiram Eldar tells me that Mathematica considers -1 times a prime to be a
prime.

Select[Range[-10, 10], PrimeQ]
{-7, -5, -3, -2, 2, 3, 5, 7}

This is wrong, and dangerous (it has led people to make mistakes in
sequences).

If negative numbers were primes we would lose unique factorization, a
cornerstone of mathematics.



More information about the SeqFan mailing list