News for hackers. Stuff that matters.
Re:Do we have negative prime numbers? by inglor_cz on Saturday January 16, 2021 @10:16AM (#25802686)
Ah, my original field of expertise. Once, when the dwarves still slept, I did a lot of work on rings and ideals.

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.

Re:Do we have negative prime numbers? by ot on Saturday January 16, 2021 @12:04PM (#25803501)
> You will not gain any results from it, though.

OTOH you lose unique factorization; it’s not a good trade.

Re:Do we have negative prime numbers? by giomasce on Saturday January 16, 2021 @12:19PM (#25803625)
Unique factorization is always meant up to unities. You haven't really lost anything.
Re:Do we have negative prime numbers? by ot on Saturday January 16, 2021 @12:58PM (#25803915)
Hey Gio, long time no see :)

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.

Re:Do we have negative prime numbers? by giomasce on Saturday January 16, 2021 @01:47PM (#25804327)
Hey, didn't notice the nick! Hi!

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.

Re:Do we have negative prime numbers? by ot on Saturday January 16, 2021 @02:00PM (#25804436)
I've definitely seen the definition

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.

Re:Do we have negative prime numbers? by sfgweilr4f on Saturday January 16, 2021 @10:36AM (#25802855)
summarised as: yeah no.

What about complex numbers? is there something similar there? Not even so much necessarily on the negative numbers. Anything interesting amongst the Js?

Re:Do we have negative prime numbers? by pmiller2 on Saturday January 16, 2021 @10:47AM (#25802942)
Yes, there is such a thing as complex prime numbers.

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...

Re:Do we have negative prime numbers? by lrossi on Saturday January 16, 2021 @10:54AM (#25802997)
Prime numbers in 2 dimensions. I’ve never thought of this before, but I like the idea.

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.

Re:Do we have negative prime numbers? by pmiller2 on Saturday January 16, 2021 @10:58AM (#25803027)
If you like that, then you'll love this: https://en.wikipedia.org/wiki/Ulam_spiral
Re:Do we have negative prime numbers? by akhann on Saturday January 16, 2021 @01:39PM (#25804257)
Oh cool, thanks for posting this! I used to do that back in school to kill time and later started using it to create drawings by following connect-the-dots rules. We had a get together some time ago (before Covid) where we did communal painting, and one of the rules produced a nice bird-looking thing. :) Great to see there is a name for this sort of thing.
Re:Do we have negative prime numbers? by edoceo on Saturday January 16, 2021 @01:15PM (#25804065)
I did! Thanks¡
Re:Do we have negative prime numbers? by Sharlin on Saturday January 16, 2021 @11:13AM (#25803140)
There are patterns along the coordinate axes and also along the diagonals, but otherwise the distribution looks pretty random: https://commons.wikimedia.org/wiki/File:Gauss-primes-768x768...
Re:Do we have negative prime numbers? by ogogmad on Saturday January 16, 2021 @10:58AM (#25803028)
And 4 dimensions: See Hurwitz quaternions.
Re:Do we have negative prime numbers? by pmiller2 on Saturday January 16, 2021 @11:34AM (#25803294)
Huh, I'd never heard of that one. I suppose that means that E8 is the equivalent for octonions? That loses the concept of "prime," which is no surprise, because the octonions are not a field, but I wonder if one could bring it back by substituting irreducible representations for primes, somehow? I'm not sure how to carry this off, because I dropped representation theory in grad school, but it seems like an interesting concept to play with, at least.
Re:Do we have negative prime numbers? by sfgweilr4f on Saturday January 16, 2021 @10:51AM (#25802977)
There goes my weekend in a mathematical whoosh.
Re:Do we have negative prime numbers? by pmiller2 on Saturday January 16, 2021 @10:57AM (#25803018)
You're welcome. ;)
Re:Do we have negative prime numbers? by wodenokoto on Saturday January 16, 2021 @12:17PM (#25803609)
In this context, what is a ring?
Re:Do we have negative prime numbers? by mafaa on Saturday January 16, 2021 @12:46PM (#25803829)
https://en.m.wikipedia.org/wiki/Ring_(mathematics) it’s a little hard to describe as it’s fairly abstract. It’s a structure that is subset of abelian groups (groups where operations on elements of the group don’t depend on the order written, ie x+y = y+x). For example the set of ints with “normal” addition and multiplication is a communicative ring
Re:Do we have negative prime numbers? by ogogmad on Saturday January 16, 2021 @01:00PM (#25803930)
A number system with a notion of addition and multiplication. Examples are the integers, rationals, complex numbers, polynomials over any of the above, and so on.

From a programming point of view, imagine a type with an overloaded + and * operator. You'll be close.

Re:Do we have negative prime numbers? by drdeca on Saturday January 16, 2021 @12:57PM (#25803910)
A set equipped with operations addition , negation, multiplication, and often a 1 as an identity element of the multiplication, where the addition is associative and commutative and has the negation as its inverse, and the multiplication distributed over the addition. Sometimes people don’t always require that they include a unit for the multiplication.

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.

Re:Do we have negative prime numbers? by amluto on Saturday January 16, 2021 @12:39PM (#25803776)
Re:Do we have negative prime numbers? by cozzyd on Saturday January 16, 2021 @12:51PM (#25803860)
Depends on if the context is dwarves or group theory.