The relation between irreducible and primes Am I right in thinking that the conventional definition of a prime integer (can only be written as itself times $1$ and has no other factors) is actually the definition for irreducible?
Is it true that this is given because prime and irreducible are equivalent in a ring and it the above definition is so much easier than explaining that a number $p$ is prime if and only if “$p$ divides $ab$” implies either “$p$ divides $a$” or “$p$ divides $b$”. 
Why are these equivalent?
Are there any simple examples of numbers that are either prime or irreducible but not both? 
 A: The set of integers is Unique Factorization Domain, that is, every element can be uniquely factorized. In UFD, a non-unit element is prime if and only if it is irreducible. So in $\mathbb{Z}$, there is no counterexample.
In $\mathbb{Z}[\sqrt{5}]$, which is a set of elements of the form $a+b\sqrt{-5}$ where $a$ and $b$ are integers, $9$ can be written in two forms,
$$
9=3^2 = (2-\sqrt{-5})(2+\sqrt{-5})
$$
and $3$ divides $(2-\sqrt{-5})(2+\sqrt{-5})$ but does not divide neither $2-\sqrt{-5}$ nor $2+\sqrt{-5}$. So $3$ is not a prime here. You can also see that $\mathbb{Z}[\sqrt{-5}]$ is not UFD. However, it is an irreducible element. This can be shown by solving the following equation
$$
3=(a+b\sqrt{-5})(c+d\sqrt{-5})
$$
for integers $a,b,c$ and $d$. Long and uninteresting calculation will show that $b=d=0$ and either one of $a$ and $c$ is $1$, and the other one is $3$.
Conversely, in integral domain $R$, being prime always implies that it is an irreducible element. Suppose a prime $p$ is reducible, so there are two non-unit elements $a,b$ such that $p=ab$. Since $p$ divides $ab=p$, by the definition of the primality, $p$ must divide $a$ or $b$. We may assume that $p$ divides $a$, and there is $c\in R$ such that $pc=a$. Thus
$$
p=ab=pcb \implies cb=1
$$
so it contradicts that $b$ is non-unit. The cancellation works because we are working in the integral domain.
A: You're pretty much right: In a general commutative ring $R$, the property
\begin{align*}
p = ab \Rightarrow a \in R^* \vee b \in R^*
\end{align*}
is called irreducibility. Primality on the other hand is the property 
\begin{align*}
p\mid ab \Rightarrow p\mid a \vee p \mid b.
\end{align*}
If $R$ is a UFD (e.g. $R = \mathbb{Z}$), an element has one of these two properties iff it has the other one, so the two notions coincide. Therefore a prime element in $\mathbb{Z}$ can be defined as a number that is irreducible.
BUT: Primality and irreducibility are not, in general, the same: While primes are always irreducible in integral domains, the number $3 \in \mathbb{Z} \hspace{-0.1cm} \left[ \sqrt{-5} \right]$ is an example of an irreducible element which isn't prime.
A: The definitions are equivalent in a unique factorization domain like $\mathbb Z$. In a non-UFD, there is still a set of prime numbers and a set of irreducible numbers, but they don't overlap completely.
For example, $-37$ is not divisible by any number in $\mathbb Z$ closer to 0 than itself, other than $-1$ and 1. Hence it is irreducible in $\mathbb Z$. But it is also prime, because in any product $ab$ that is divisible by $-37$ we will find that either $a$ or $b$ is a multiple of $-37$, or maybe they both are.
Compare to $74$. That's obviously not prime, and it's not irreducible either, it's reducible. We see that $74 \mid 148$, but if we express 148 as $-4 \times -37$, we see that 74 divides neither the $a$ nor the $b$.
Now let's take a look at an integral domain like $\mathbb Z[\sqrt{-70}]$. In that domain, $-37$ is still irreducible, because it's not divisible by any number closer to 0 other than $-1$ and 1.
But now we see that $-37 \mid (2 - \sqrt{-70})(2 + \sqrt{-70})$, yet neither $2 - \sqrt{-70}$ nor $2 + \sqrt{-70}$ is divisible by $-37$. Numbers like 3 and 13 are still irreducible and prime in $\mathbb Z[\sqrt{-70}]$, though.
As for a number that is prime but not irreducible, consider $\mathbb Z_6$, which consists only of 0, 1, 2, 3, 4, 5 (addition and multiplication "wrap around" to keep things within the ring). Verify that $$3 = 3^2 = 3^3 = 3^4 = \ldots = 3 \times 5 = 3 \times 5^2 = \ldots$$ but also that the only way to get 3 as a product in this ring is to include 3 at least once as a multiplicand.
P.S. I chose $\mathbb Z[\sqrt{-70}]$ rather than $\mathbb Z[\sqrt{78}]$ because even though we have to deal with complex numbers, things are in some ways much simpler.
A: In a ring in general the definitions are not the same;  being prime is rather the stronger property, this is literally true when there are no zero-divisors. (Note that the definition of irreducible needs to be modified a bit to account for invertible elements other than $1$.) 
Consider for example the ring of polynomials without linear term, that is polynomials of the form: 
$$a_0 + a_2X^2 + a_3X^3 + \dots + a_nX^n$$ 
In this structure $X^2$ is irreducible, yet not prime since $X^2$ divides $X^3 \times X^3$ yet not $X^3$. 
However, the definitions are equivalent in a principal ideal domain or more generally in a unique factorization domain, or in even more general structures. 
Since the integers are such a domain, the definitions are equivalent in that context.

You can also construct examples in the integers by restricting to sub-semigroups. For example if you consider only the positive integers whose decimal digit expansion end in $1$, then this is a multiplicative subsemigroup with identity. 
In that structure $21$ is irreducible, yet not prime: $21$ divides $81 \times 2401$, the numbers on the right being $3^4$ and $7^4$ respectively.
A: In a domain, every prime is irreducible.
A standard example that the converse does not always hold is
$$
3 \cdot 3 = 9 = (2+\sqrt{-5})(2-\sqrt{-5})
$$
in the ring $\mathbb Z[\sqrt{-5}]$. Then $3$ and $2\pm\sqrt{-5}$ are irreducible but not prime.
