TITLE: Is zero a prime number?
QUESTION [51 upvotes]: 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?

REPLY [10 votes]: 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:

We want every non-zero natural number to have a unique factorization into primes.
We want the primes to be precisely those elements of $\mathbb{N}$ that cover $1$ with respect to the divisibility order.
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$.