Do we have negative prime numbers?
math.stackexchange.com
math.stackexchange.com
Prime numbers are generators of prime ideals in the domain of Z. Of course, any multiplication with any divisor of 1 (and -1 is a divisor of 1), will leave the prime ideal intact.
So yes, you can call -2 or -11 a prime number if you want to. You will not gain any results from it, though.
What about complex numbers? is there something similar there? Not even so much necessarily on the negative numbers. Anything interesting amongst the Js?
If you restrict yourself to looking at numbers whose real and imaginary parts are both integers, then you have a ring called the Gaussian integers. A Gaussian integer a + bi is prime if and only if neither a nor b are zero and a^2 + b^2 is a prime number in the integers, or it is a product of +-1 or +-i and a prime integer of the form 4k+3.
Rabbit hole begins here: https://en.wikipedia.org/wiki/Gaussian_integer#Gaussian_prim...
Interestingly, when plotting them, some patterns appear: https://demonstrations.wolfram.com/GaussianPrimes/
I would have expected patterns due to symmetry around the axes, but there seems to be more than that.
OTOH you lose unique factorization; it’s not a good trade.
The definition "up to unities" is generally when you abstract things and talk about unique factorization rings. Then your "primes" (formally irreducible elements) become equivalence classes up to unities.
In the concrete integers though AFAIK it's more conventional to only consider positive primes, so that the decomposition is canonical. Probably I should have said that you lose canonicity.
Well, if you're speaking about non-negative integers, you don't have the problem of the primality of negative numbers.
If you're considering relative integers, still you don't really have a unique factorization property, because negative integers do not have a factorization altogether (in terms of positive primes). So you have to stipulate that a prime factorization is not just a "product of primes", but a "product of primes, perhaps times -1", which is still not the way you usually define it. So I am not totally convinced.
In the end, everybody just pick the definition they like.
x = u p_1 p_2 ...
where u is any unity, but I agree that people pick the definition they need depending on the context.
An example of a ring is the set of integers, as is the set of integers mod 6, as is any field. A non-example is the set of non-negative integers.
From a programming point of view, imagine a type with an overloaded + and * operator. You'll be close.
On the other hand if you're programming a function isPrime() for some practical purpose, then whether you include negative numbers will be dependent on that purpose. Whether you include floating point numbers will be between you and your conscience. ;-)
https://en.wikipedia.org/wiki/Prime_ideal
https://en.wikipedia.org/wiki/Zariski_topology#Spectrum_of_a...
rational prime, primitive ideals, prime ideals, primaries and semiprimes... ... if p is a rational prime and d be a squarefree integer, then p is prime in Z[√d] if and only if f_d(x)= x²-d is irreducible mod p.
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.
We could but it's inconvenient, so we don't usually allow that.
Specifically, allowing negative numbers (or the number 1) to be primes screws up the fact that every natural number otherwise has a unique factorization.
https://en.wikipedia.org/wiki/Fundamental_theorem_of_arithme...
> every integer greater than 1 either is a prime number itself or can be represented as the product of prime numbers and that, moreover, this representation is unique, up to (except for) the order of the factors.
[Edit] Here: https://en.wikipedia.org/wiki/Unique_factorization_domain