62. Unique factorization for integers

62.1 The Fundamental Theorem of Arithmetic

It is a fact, called The Fundamental Theorem of Arithmetic, that a given positive integer $m > 1$ has a unique factorization into a product of positive primes. Thus $12 = 2\times 2\times 3$, $111 = 3\times 37$, and so on. The factorization of a prime is that prime itself: thus the prime factorization of 5 is 5. The Fundamental Theorem of Arithmetic is proved in a series of problems in Chapter 103 as an illustration of the proof techniques discussed there.

The factorization into primes is unique in the sense that different prime factorizations differ only in the order they are written.

Here is the formal statement:

62.2 Theorem

Let $m$ be an integer greater than 1. Then for some integer $n\geq 1$ there is a unique list of primes $p_{1},p_{2},\ldots ,p_{n}$ and a unique list of integers $k_{1},k_{2},\ldots ,k_{n}$ such that

FT.1 $p_{i} < p_{i+1}$ for $1\leq i < n$.

FT.2 $m = p_{1}^{k_{1}}p_{2}^{k_{2}} \cdots p_{n}^{k_{n}}$.

62.2.1 Example

$$12 = 2\times 2\times 3 = 2\times 3\times 2 = 3\times 2\times 2$$

Theorem 62.2 specifically gives $12 = 2^{2} \times 3^{1}$. Here $n = 2$, $p_{1} = 2$, $p_{2} = 3$, $k_{1} = 2$ and $k_{2} = 1$.

62.2.2 Exercise Give the prime factorizations of 30, 35, 36, 37 and 38. (Answer on page 246.)

62.3 Definition: exponent of a prime in an integer

The largest power of a prime $p$ which divides a positive integer $n$ is the exponent of $p$ in $n$ and is denoted $\mathrm{e}_{p}(n)$.

62.3.1 Example The exponent of 2 in 24 is 3; in other words, $\mathrm{e}_{2}(24) = 3$. You can check that $\mathrm{e}_{37}(111) = 1$ and $\mathrm{e}_{37}(110) = 0$.

62.3.2 Exercise Find the exponent of each of the primes 3, 7 and 37 in the integers 98, 99, 100, 111, 1332, and 1369. (Answer on page 246.)

The fact that the prime factorization is unique implies the following theorem:

62.4 Theorem

Let $m$ and $n$ be positive integers. If $m \mid n$ and $p$ is a prime, then $\mathrm{e}_{p}(m) \leq \mathrm{e}_{p}(n)$. Conversely, if for every prime $p$, $\mathrm{e}_{p}(m) \leq \mathrm{e}_{p}(n)$, then $m \mid n$.

62.5 Prime factorization in Mathematica

FactorInteger is the Mathematica command for finding the factors of an integer. The answer is given as a list of pairs; the first coordinate in each pair is a prime and the second coordinate is the exponent of the prime in the number being factored. Thus if you type FactorInteger[360], the answer will be {{2,3},{3,2},{5,1}}, meaning that $360 = 2^{3} \cdot 3^{2} \cdot 5$.

62.5.1 Exercise Factor all the two-digit positive integers that begin with 9. (Answer on page 246.)

62.5.2 Exercise Show that for every positive integer $k$, there is an integer $n$ that has exactly $k$ positive divisors.

62.5.3 Exercise (hard) Prove Theorem 62.4.

62.5.4 Exercise (discussion) Type FactorInteger[6/7] in Mathematica. Explain the answer you get. Should the name “FactorInteger” be changed to some other phrase?

Pages 87–88 of the book (PDF).