# What is the definition of prime number?

Every number has the factors of $1$, itself, $-1$, and the negative version of itself (itself multiplied by $-1$).

So let's take for example $5$, it has the factors:

$1$
$5$
$-1$
$-5$

Since the definition of a prime number is a number with the factors 1 and itself, should this not mean that all numbers are composite?

• Wiki : A prime number (or a prime) is a natural number$>1$ that has no positive divisors other than $1$ and itself. Commented Nov 8, 2014 at 14:31
• Commented Nov 8, 2014 at 14:31
• Commented Nov 8, 2014 at 14:33
• Thank you for your very helpful question and all the valuable answers. I used your question in my answer to the question $a^2−b^2=37$, evaluate $a^2+b^2$ at this link. Thank you for all of your help! Commented Mar 19 at 14:28

The morally correct definition of prime number is given by Euclid's lemma. If you have a ring that is an integral domain ($ab=0\implies a=0$ or $b=0$), that is, a set with sum, multiplication, all the known rules and a $0$ and a $1$, a non-unit non-zero element is said to be prime if $p\mid ab\implies p\mid a$ or $p\mid b$. Where $p\mid a$ means that $a=pq$ for some other $q$. If a number $p$ has this property and if $u$ is invertible, i.e. there is $v$ for which $uv=vu=1$, then $up$ has this property too. If for two numbers $a,b$ there is a unit $u$ for which $a=ub$, we say that $a$ and $b$ are associates. When we want to look at factorization of numbers, we thus take from the set of all primes of your domain, a set of representatives: that is, a subset of the primes such that every prime is associate to one of the primes in our representatives set, and such that no representatives are associates. In the domain $\Bbb Z$ of integers, the (positive) prime numers $2,3,\ldots$ are a set of representatives of all the primes of $\Bbb Z$, $\pm 2,\pm 3,\ldots$. The units of $\Bbb Z$ are $1,-1$, which is what you observed.

You're essentially asking for how to generalize the notion of prime from the positive integers to the (nonzero) integers. This is complicated by the fact that the positive integers have only one unit, $1$, while the integers have two, $1$ and $-1$. So where you can insist on the prime numbers in two factorization being equal in the positive integers, this statement only holds because they are special in having only a single unit. The general case is that two factorizations must be identical up to units, which in this case means that $n$ and $-n$ are identified for the purpose of factorization.

You might consider what happens in rings which have more than two units.

That would lose the useful idea of a prime number. We could also say that $1/2$ is a factor of 5. So we restrict the possible factors to positive integers.

• I suppose this makes sense, but why limit it when other types of numbers systems do exist? Commented Nov 8, 2014 at 14:41
• If you are dealing with whole numbers, then the primes you know of make sense. If you are talking about polynomials, like $x^2+1$, then you can talk about prime polynomials with no factors of smaller degree. If you allow complex numbers, then there are no prime polynomials. So 'you pays your money and you takes your choice'. Commented Nov 8, 2014 at 14:50
• @Michael There are prime polynomials in $\Bbb C[X]$! Namely, $x-\alpha$ for $\alpha\in\Bbb C$.
– Pedro
Commented Nov 8, 2014 at 15:03
• Fair enough.... Commented Nov 8, 2014 at 15:05
• @Michael Not fair enough. True.
– Pedro
Commented Nov 8, 2014 at 23:51

Just for a University reference, from the Cambridge Dictionary Definition of a Prime:

a number that cannot be divided by any other number except itself and the number

Clearly, if negative numbers were allowed as factors, there would be no primes. So the number under consideration to be a prime itself cannot be considered as an integer that has the properties (again from the University dictionary definition):

Integer definition: a whole number and not a fraction: The numbers -5, 0, and 3 are integers.

natural number noun [ C ] MATHEMATICS specialized UK /ˌnætʃ.ər.əl ˈnʌm.bər/ US /ˌnætʃ.ɚ.əl ˈnʌm.bɚ/ Add to word list a whole number (= a number such as 1, 3, or 17, that has no fractions and no digits after the decimal point) that is greater than zero, or sometimes that includes zero itself

Thus, it seems that a prime number needs further restrictions to describe it fully. This happens, for instance in the case of solving the following problem:

Let $$a$$ and $$b$$ be integers, and $$a*b=37$$. Solve for $$a$$ and $$b$$.

Obviously $$37$$ is a prime number (further restricted to be a natural number greater than zero). But that does not mean $$a>0$$ and $$b>0$$.

Indeed if $$a=1$$ and $$b=37$$ solves $$a*b=37$$ then also $$(-1)*(-37)=37$$. In computer programming, this concept would be called type conversion.

The University of Virginia describes this concept at the following link on Type Conversions:

#### Type Conversions

As we have seen with the example of dividing two integer, operators are defined on specific types and return a specific type. What if we write 2./3? The first operand is a double, whereas the second is an integer. This is called a mixed expression. For consistency, one type must be converted to match the other before the operator is applied.

So the point being is that the factors of a natural prime number greater than zero are "natural numbers including only 1 and the prime number itself".

Type casting is essential to define a prime number, so that further mathematical steps apply needed type re-casting (if necessary) before proceeding.