55

Is zero a prime number?

When talking about prime numbers, it seems like the examples given $(2,3,5,7,11,13,...)$ have the property that they have no factors less than themselves and greater than one. But $0$ also has this property, so is it prime? If not, why not?

Is zero odd or even?

When talking about even numbers, it seems like the examples given $(2,4,6,8,...)$ have the property that, when dividing them by $2,$ have a non-zero quotient and a zero remainder; odd numbers $(1,3,5,7,...)$ have a non-zero quotient and a remainder of $1.$ So, is $0$ odd? even? neither odd nor even?

Is zero a number?

I've heard that every number is either odd or even, but if $0$ is neither odd nor even, does that mean it isn't even a number?

PrincessEev
  • 43,815
  • 10
    Zero is not prime. However, the ideal $\langle 0 \rangle$ is a prime ideal. – Lisa Apr 17 '15 at 21:11
  • 10
    @Lisa: Not always true. It is a prime ideal only in rings without zero divisors. – Cameron Buie Jun 25 '18 at 23:50
  • 1
    0 is even. When you divide 0 by 2, the remainder is 0. I cannot figure out at all why you think the remainder on division of 0 by 2 is 1. I cannot figure out what your question is. I cannot figure out what your confusion is. Would it be possible for you to tell me in a comment what actually is your thought process leading to confusion? How do you think? What is your idea on how to deduce statements from other statements related to this problem? – Timothy Mar 08 '20 at 01:54

7 Answers7

135

If you are willing to accept the integers as numbers, then you should have no trouble considering $0$ a number. For one willing to define even numbers as "integer multiples of $2$" then it's similarly clear that $0$ should be considered even. I don't want to spend a lot of space here rehashing the evenness of $0$ since there are already questions dedicated to that problem, but fortunately that makes it easy to direct you to the answer: Is zero odd or even?

I've also found some more discussions on the "numberness of zero" that you might find useful: What's the hard part of zero? , Why do some people state that 'Zero is not a number'?

The question as to whether or not it should be considered prime is more interesting.

What should primes be?

After you learn about divisibility and factorization, this idea arises about breaking numbers down into smaller parts (sort of like describing matter with smaller and smaller parts). Divisibility makes a partial order on the nonegative integers. This just means that since $12=3\cdot 4$, the "smaller parts" 3 and 4 dividing 12, we can record this as $3\prec 12$ and $4\prec 12$. Furthermore $2\prec 4$ because $2$ divides $4$, and so on. Since $1$ divides everything, we would say that $1\prec n$ for any nonegative integer $n$.

In physics, we are interested in the smallest things from which everything is built from (the "atoms"!). The idea of atoms has two parts:

  • they should all be "small"
  • they should build everything else

Well, we can't let $1$ be such a thing, because it would be the only smallest thing, and moreover you can't build anything from $1$ alone. So it is in a sense, too simple.

The next best candidates are those things just above $1$. What just above means becomes clearer if you draw a picture:

divisibility diagram

This is a sort of Hasse diagram for the nonnegative integers partially ordered by divisibility. Since the diagram is infinite it's not really a Hasse diagram, and the lines to zero don't really come from any numbers, but this is good for our purposes.

From the diagram you can easily see that the primes lie in the first row above $1$, and so they are "as small as possible" without being $1$, and moreover, everything above them (excepting zero) is built out of various combinations of the primes. The gradeschool definition of prime number basically amounts to the fact that nothing lies between $1$ and $p$ for each prime.

Zero, paradoxically, is really aloof and nowhere near the rest of the primes: he doesn't seem very small after all. Moreover he is pretty useless for building numbers since $0n=0$ for any $n$.

So for reasons like these, $0$ is not considered as a prime: he doesn't make a good "atom."

rschwieb
  • 153,510
  • 3
    Zero is sort of quirky; you sort of want to ignore it when you're thinking about domains, but you want it to be prime (when it is) in settings where zero divisors are interesting. –  Oct 28 '15 at 17:59
  • Why do you refer to zero as "he"? – celtschk Oct 29 '15 at 20:56
  • 9
    @celtschk Artistic license? – rschwieb Oct 30 '15 at 02:33
  • 3
    +1 for referring to zero as "he" (after referring to one as "it"). – Brian Tung Oct 30 '15 at 17:32
  • @celtschk you prefer zero be a "she"? – ziggurism Dec 27 '17 at 15:58
  • Perhaps paradoxically one might consider that this answer implicitly constructs the number zero as the exponent of all primes in the factorisation of the number $1$. – it's a hire car baby Oct 29 '18 at 09:58
  • 1
    @RobertFrost Hardly a paradox... seems like a very natural thing to me. People have known about the monoid isomorphism between $(ℕ^+,\cdot )$ and $(⊕_{i∈ℕ}ℕ, +)$ for a long time. – rschwieb Oct 29 '18 at 16:09
  • @rschwieb I guess by "perhaps paradoxically" I have a vague notion that this leads to the proposition that addition comes after multiplication, in the sense that multiplication plus limits semantically encapsulates zero (and therefore addition), when usually I think of addition coming first and multiplication following after. Does that make sense or am I thinking nonsensically? – it's a hire car baby Dec 07 '18 at 12:18
  • 2
    So if we were talking about ideals instead of numbers in $\mathbb{Z}$, then we would agree that the zero ideal is a prime ideal, right? Why is the picture so different for ideals? – ziggurism Apr 04 '20 at 15:25
  • @ziggurism It’s because the notions of “prime” and “irreducible” elements are slurred together in PIDs. The context of the question is “prime numbers”, which is focused more on irreducibility, and not ideals. So yes, it isn’t consistent with the zero ideal being allowed to be prime, but it is consistent with 0 never being irreducible. – rschwieb Apr 04 '20 at 16:51
  • At no point am I arguing that there are no statements that make sense with a definition of “prime element” that allows zero, in just highlighting the reasons why we prefer this way when teaching prime numbers for the first time. – rschwieb Apr 04 '20 at 16:52
  • 1
    Ok so this is really the answer for "why is zero not irreducible", but we allow ourselves to conflate irreducibility and primality in $\mathbb{Z}$. But to be clear, the Hasse diagram of ideals of $\mathbb{Z}$ ordered by reverse inclusion looks the same as the above divisibility diagram, right? – ziggurism Apr 04 '20 at 16:58
  • @ziggurism yes, it is the opposite diagram of containment, since “contains means divides” in PIDs – rschwieb Apr 04 '20 at 19:03
  • Maybe this diagram tells why the zero ideal is the generic point – ziggurism Apr 04 '20 at 19:11
  • This answer makes it clear that while not being prime, 1 is also not composite either. But what about 0? Is it composite? – ziggurism Oct 03 '20 at 14:00
  • 2
    @ziggurism I’d say 0 and 1 don’t really belong in this graph, although they “fit” this way. All of the interesting things about factorization happen strictly between them. Remember, technically I can’t even write anything on the other end of those lines from 0. While $0$ is divisible by more than one prime, I wouldn’t call it composite: that’s more of a statement about a unique factorization, which 0 does not have. – rschwieb Oct 03 '20 at 16:49
26

Zero is not a prime number out of almost every definition of prime numbers:


  1. Prime numbers are those natural numbers that are divisible solely by the unity ($1$) and themselves. $0$ is divided by every natural number! $5\cdot0=0,n\cdot0=0,\ldots$ (or not divided at all if you want to exclude zero from the definition of (natural) number).
  2. Prime numbers are the cornerstone of arithmetics from its fundamental theorem: every (non-zero) natural number has a unique representation in prime numbers. $0$ only represents itself and that representation is not unique: $0=0^1=0^2=0^{12807}\cdot2^{9987}\cdot97^1\ldots$

Zero is indeed even as even are defined as those numbers divisible by $2$, and $2\cdot0=0$, therefor $0$ is divisible by $2$. (Unless you want to exclude zero from the definition of (natural) number)

So, the final question: Is zero a number?

In most sets defined as numbers: Integers ($\mathbb Z$), Rationals ($\mathbb Q$), Reals ($\mathbb R$), Complex ($\mathbb C$), then $0$ is an important element. It cannot be excluded from the definition of number in those sets.

The question is about natural numbers ($\mathbb N$), and you can construct a number theory with $0$ as part of the natural numbers and without $0$ as part of the natural numbers. I like to include $0$ as a natural number as it seem to solve some problems more easily than excluding it, yet it adds some complexities.

Note that in the definitions of “prime number” it is better to explicitly exclude $0$, as zero has no purpose in the fundamental theorem of arithmetics, all arithmetics based on that theorem can be done in the set $\mathbb N\setminus\{0\}$ (this is the Natural numbers explicitly excluding $0$).

Let's write the fundamental theorem of arithmetics if $0\notin\mathbb N$ (by number then we mean any natural number except 0)

FTA with no zero

Every number $n$ has a unique representation in prime numbers $n=p_1^{k_1}\cdot p_2^{k_2}\cdots p_i^{k_i}$ (for a finite set of primes $p_j$).

And let's formulate it for $0\in\mathbb N$

FTA with zero

Every number $n$ (with $n\ne0$) has a unique representation in prime numbers $n=p_1^{k_1}\cdot p_2^{k_2}\cdots p_j^{k_j}\cdots$ (where $p_j$ is the $j$th prime number (and $k_j$ can be $0$)).


In the first formulation we cannot have $0$ as exponent, so we would strip all primes that don't divide $n$. We just won't include them in the formulation. In the second formulation we must except $0$ from every number, but we can, on the other hand, include all prime numbers and if $p_j$ does not divide $n$ then we set the exponent $k_j=0$.

  • 6
    In more general contexts, the definition at the top is of "irreducible", whereas "prime" is $p \mid ab \implies p \mid a \vee p \mid b$. –  Oct 28 '15 at 18:04
  • I'm not sure I follow your logic in your last paragraph. That FTA version doesn't hold as you wrote it, because it violates the uniqueness constraint. Furthermore, the first version should exclude 1, as it cannot be represented as a unique product. Therefore, FTA is usually formulated as 'every integer (or natural number) greater than 1.. '. Also, afaik, the accepted definition of 'natural numbers' is that they represent the counting numbers, 1,2,3 etc. Usually, when you want to include zero, you talk of 'whole numbers' instead. (but I'm no mathematician, I can be off) – Abel Jan 19 '19 at 00:40
  • 1
    @Abel, both versions of the FTA can be defined for 1. The unique representaron of 1, when you don't include 0 as a number, is given when the set of primes is empty. In the second formulation (with zero) is when all exponents are 0. – Carlos Eugenio Thompson Pinzón Jan 19 '19 at 15:03
  • Since there is disagreement over what the set of natural numbers is, you should make it clear what you mean by natural number. – Steven Alexis Gregory Aug 14 '19 at 12:50
  • FTA is just the immediate consequence of $\Bbb Z$ being a UFD, which by definition states that every nonzero, non-unit element of an UFD has a factorization into irreducible elements which is unique up to units. – Divide1918 Dec 19 '20 at 12:26
11

A: No.

A: Even.

A: Yes.

user153012
  • 12,240
10

Q. Is zero a prime number?

No; but, this is basically just by convention. Here's why.

First, define

$$\mathbb{N} = \{0,1,2,3,\ldots\}$$

so that in particular, $0$ is a natural number.

Preliminary chitchat. A prime number could be defined as a natural number $p$ satisfying the following two conditions:

$$(0) \;\;\mathop{\forall}_{a,b \in \mathbb{N}}\;\;\;p \mid ab \rightarrow (p \mid a) \vee (p \mid b), \qquad (1) \;\;p \mid 1 \rightarrow \mathrm{FALSE}$$

Note that $\mathrm{FALSE}$ is the identity element with respect to Logical OR, which explains to some extent where condition (1) comes from.

If we accept this definition, then $0$ is prime, but $1$ is not.

The usual conventions. Despite the above discussion, we usually declare that $0$ is not prime. There's a couple of reasons for this:

  1. We want every non-zero natural number to have a unique factorization into primes.
  2. We want the primes to be precisely those elements of $\mathbb{N}$ that cover $1$ with respect to the divisibility order.
  3. We want primes to form an antichain with respect to divisibility.

So the definition of "$p$ is prime" becomes:

$$(0) \;\;\mathop{\forall}_{a,b \in \mathbb{N}}\;\;\;p \mid ab \rightarrow (p \mid a) \vee (p \mid b), \qquad (1) \;\;p \mid 1 \rightarrow \mathrm{FALSE}, \qquad (2)\;\; p = 0 \rightarrow \mathrm{FALSE}$$

Under these conventions, $0$ is not a prime.

Why somedays I disagree with the convention that $0$ isn't prime.

By a commutative monoid with $0$, I mean a commutative monoid $M$ together with an element $0 \in M$ satisfying $0a = 0$ and $a0 = 0$.

The way I like to think about the set $P$ of prime numbers is as follows: $P$ is the unique subset of $\mathbb{N}$ such that if $F(P)$ is the commutative monoid with $0$ freely generated by $P$, then the obvious monoid-with-$0$ homomorphism $$F(P) \rightarrow \mathbb{N}$$ is an isomorphism.

Under this definition, $0 \in P$.

goblin GONE
  • 67,744
  • 4
    @MorganRodgers The idea of primes has evolved over the history of math. The definition $p\mid ab\Rightarrow p\mid a$ or $p\mid b$ is the final definition of prime. We lie about it early on in math, using "prime" to mean "positive natural which is irreducible." (Or maybe not lie, but simply refer to a related concept, take your pick on the question of culpability.) – anon Sep 25 '15 at 15:05
  • 2
    @MorganRodgers, the definition I "propose" is standard in ring theory. Your definition is closer to the ring-theoretic notion of an irreducible element. – goblin GONE Sep 25 '15 at 15:06
  • @goblin, so 1 is not in $P$ but it is still the identity in the monoid? – ThomasMcLeod Sep 19 '18 at 02:55
  • But what's special about the idea of "monoid with 0"? We could have just as well said "monoid", in which case $P$ is the unique set such that $F(P)\cong\mathbb{N}_{+}$, but now $0\notin P$ – ziggurism Apr 04 '20 at 19:18
10

By definition, a prime number is a non-$0$, non-unit integer $p$ such that for any integers $m,n$, if $mn$ is a multiple of $p,$ then $m$ or $n$ is a multiple of $p$. Aside from the whole non-$0$ condition, it fits perfectly.

It is even, as it is a multiple of $2$ (as it is a multiple of every number).

It is a (real/complex/integer) number.

Cameron Buie
  • 102,994
  • 1
    If 0 were a prime we would not have uniqueness in the fundamental theorem of arithmetic. Pretty good reason to leave 0 out. – M.B. Oct 25 '13 at 10:54
  • 3
    @M.B. That, plus a whole load of very similar cases, is one reason $1$ isn't considered a prime either. – Arthur Oct 25 '13 at 11:52
  • 1
    @downvoter: Any constructive criticism to offer? – Cameron Buie Jun 26 '18 at 23:12
  • Perhaps in a question at this level, "unit" should be defined. Are you talking about non negative integers or about all integers? – Steven Alexis Gregory Aug 14 '19 at 12:47
  • 1
    @M.B. Unique factorization still holds if we consider zero a prime, precisely because it (vacuously) satisfies the condition in the above answer. – GuillaumeDufay Dec 25 '20 at 02:21
  • 1
    @GuillaumeDufay If we consider $0$ a prime number, then it would be rather awkward to still exclude it from the numbers whose prime factorisation we consider. And $0$ would not have a unique factorisation, $0 = 0 = 0\cdot 2 = 0 \cdot 2^3\cdot 5^{17} = \ldots$. – Daniel Fischer Dec 25 '20 at 19:10
  • @DanielFischer Zero is excluded from this characterization of unique factorization for the obvious reason you just mentioned, which has nothing to do with being nonprime. Six, for example, is nonprime but is not excluded.

    I'll add that an alternative characterization of unique factorization is that every nonzero element can be written as the product of primes. If we consider zero to be a prime, then the exclusion of zero is unnecessary.

    – GuillaumeDufay Jan 12 '21 at 05:33
  • 1
    @GuillaumeDufay "every (nonzero) element can be written" is not the uniqueness. The factorisation of zero is not unique, so for the uniqueness part we must exclude zero from consideration anyway. All I'm saying is that if we declare zero a prime, then it's awkward to say "all nonzero numbers have a unique prime factorisation", more so than if we don't consider zero a prime. That doesn't necessarily imply that the disadvantages of considering zero prime outweigh the advantages, but it's a point in favour of the current convention. – Daniel Fischer Jan 12 '21 at 12:02
  • @DanielFischer Uniqueness for nonzero elements is implied simply by the existence of a prime factorization and the definition of prime. The exclusion of zero from uniqueness has nothing to do with its status as a prime. It's significantly less awkward to eliminate uniqueness (because it's implied by the simpler fact of existence) and the exclusion of zero (because if it's prime, its prime factorization exists) simultaneously. – GuillaumeDufay Jan 22 '21 at 19:13
  • @GuillaumeDufay: I have to agree with Daniel, here. It feels more awkward to exclude a prime number from those with unique prime factorizations, less awkward to exclude a non-prime from numbers that have a prime factorization. – Cameron Buie Jan 22 '21 at 21:26
  • @CameronBuie The exclusion of a nonprime becomes significantly more awkward when you consider that zero is literally the only nonprime excluded. The exclusion has nothing to do with primality. – GuillaumeDufay Jan 23 '21 at 05:19
  • @GuillaumeDufay It's the only one excluded because it's the only multiplicative annihilator. That doesn't feel unnatural to me, but your mileage may vary. – Cameron Buie Jan 23 '21 at 15:26
  • @CameronBuie Exactly. That has nothing to do with primality. – GuillaumeDufay Jan 25 '21 at 20:40
  • @GuillaumeDufay Right, so where's the awkwardness there? The awkwardness of a prime not having a unique prime factorization is clear. – Cameron Buie Jan 25 '21 at 23:36
7

Zero is not prime, since it has more than $2$ divisors.

Zero is even, since $0 = 2 \cdot 0$, and $0$ is an integer.

If we use "number" in essentially any of the usual senses (integer, real number, complex number), yes, zero is a number.

  • 6
    Dear @Bongers : I don't disagree with the observation in the first line, but in almost all sources, prime numbers are defined to be nonzero, and I think that kind of trumps anything you might say about divisors. I'm not suggesting you need to change anything: I just wanted to bring this to future readers' attention. Regards! – rschwieb Oct 25 '13 at 12:46
  • 2
    @rschwieb I find the definition of prime numbers to be non-zero an exceptionally boring reason as to why zero is not a prime number. It implies that "zero is not a prime number because someone defined it that way", which isn't true. Zero is not a prime number because it has more than two divisors, and this allows people define it out. – user1729 Oct 28 '13 at 20:19
  • @user1729 Aesthetically I totally agree with you :) I was just merely stating the reality of the printed situation. Since the "real" definition of prime requires you to exclude zero, I imagine that the "nonzero" condition appears in the "gradeschool" definition as an artifact, and they mostly just don't notice this convenience possible with their definition. What annoys me more is the fact that so many geometry texts insist a trapezoid has exactly two parallel sides... – rschwieb Oct 29 '13 at 13:27
  • 1
    @user1729 I find the definition of prime numbers to be (positive integer) numbers with exactly two divisors an exceptionally boring reason as to why zero is not a prime number. This choice of definition is no less a convention than the choice that primes be nonzero, and has the disadvantage that it does not coincide with the concept of prime that extends the useful properties of primes in the integers to other rings. – GuillaumeDufay Jan 12 '21 at 06:00
5
  • Zero is not a prime number as prime numbers are defined for integers greater than 1.

  • Zero is an even number. Definition of an even number with modular arithmetic:

$\forall x\in \mathbb{Z},\, x$ is even if and only if $x\equiv 0 \pmod 2$

As $0$ satisfies the definition, then it is an even number.

  • Of course $0$ is a number, because it is a member of some sets who contains only numbers (such as integers, real numbers, complex numbers etc.). If your question is "Is $0$ a natural number?", it's controversial. In some definitions $0$ is a natural number, but in some of them not. Mathematicians do not have an agreement on that, but I'm with the ones who do not accept it as a natural number, because some theorems which are satisfied by all natural numbers are not satisfied by $0$.
Zafer Sernikli
  • 881
  • 4
  • 11
  • 1
    It is not exactly "controversial" whether $0$ is a natural number. It is rather that either convention can be convenient depending on the context. In analysis you usually exclude $0,$ so that you can replace $\varepsilon > 0$ by $1/n$ for a natural number $n.$ Whereas in discrete mathematics, discrete probability and computer science it would be highly inconvenient to exclude $0.$ – Tommy R. Jensen Aug 12 '19 at 08:20