News for hackers. Stuff that matters.
Re:Do we have negative prime numbers? by not2b on Saturday January 16, 2021 @12:10PM (#25803552)
Classic primes are defined on the natural numbers. If you want to extend primes to cover the nonzero integers, a useful definition should preserve unique factorization; that is, there should be only one way to factor a number. The only way to do that is to say that -1 is a prime but no other negative integer is. -2 is not prime because is is -1 times 2.
Re:Do we have negative prime numbers? by ogogmad on Saturday January 16, 2021 @12:37PM (#25803759)
A prime element of a ring (like the integers) is defined to be a non-unit p that satisfies p|ab => p|a or p|b. A unit is defined to be a number that you can divide by. Therefore the units in the integers are {-1,+1}. Based on that, -2 is prime element and -1 is not.

The statement of unique factorisation is more complicated when using this definition of prime, but it allows us to talk about primes in the Gaussian and Eisenstein integers, as well as other Unique Factorisation Domains.