8.1 Divisibility, Primes, and Factorization
Chapter 7 showed how a recursive process repeatedly reduces a problem to a smaller one. Number theory begins with an equally simple reduction question:
> Can one integer be divided into equal groups of another integer with nothing left over?
This question leads to divisibility, prime numbers, and factorization. These ideas will become the raw material for Euclid's algorithm, modular arithmetic, and RSA.
Integers and exact division
The set of integers is
In this section, a divisor will always be nonzero. Let with . We say that divides , written
if there exists an integer such that
The integer is the exact quotient. The symbol is a relation symbol; it does not mean ordinary division.
Examples
Because
we have .
Because no integer satisfies , we write
read “ does not divide .”
Negative values are allowed:
because .
Every nonzero integer divides because
Also, and divide every integer.
Divisors and multiples describe the same equation
If , then is a divisor or factor of , while is a multiple of .
For example, the positive divisors of are
The positive multiples of begin
The divisor list of a fixed nonzero integer is finite, but its list of multiples is infinite.
Factor pairs prevent missed divisors
To list the positive divisors of , pair factors whose product is :
Reading both entries of every pair gives
Once the first factor passes , the same pairs appear in reverse order. This observation will later shorten prime tests.
Basic divisibility rules follow from the definition
The definition lets us prove useful rules instead of memorizing them.
Transitivity
If and , then .
Indeed, there are integers such that
Substituting the first equation into the second gives
Because , the definition proves .
Integer linear combinations
If and , then for any integers and ,
To see why, write and . Then
This rule is important because Euclid's algorithm will repeatedly replace two numbers by integer combinations without changing their common divisors.
Choose an integer, arrange its factor pairs on a mirrored divisor lattice, and test proposed divisibility arrows by supplying an integer quotient. Perfect squares visibly merge their middle pair, while invalid arrows expose the nonzero remainder that prevents exact division.
Prime and composite numbers
From now on, we focus on positive integers.
A positive integer is prime if its only positive divisors are
Examples are
A positive integer is composite if it has a positive divisor other than and .
For example,
so is composite.
The integer is neither prime nor composite. It has only one positive divisor, not exactly two. Keeping outside the primes is what makes prime factorization unique.
The integer is the only even prime. Every even integer larger than has as a proper divisor.
Why trial division stops at the square root
Suppose is composite. Then
for integers and .
If both and , then
contradicting . Therefore at least one factor is at most .
So to test whether is prime, it is enough to try prime divisors not exceeding .
Example: testing
Because
we only test the primes .
- is not even, so .
- Its digit sum is , so .
- It does not end in or , so .
- Division by gives a nonzero remainder.
No prime at most divides it, so is prime.
Prime factorization
A prime factorization writes an integer greater than as a product of primes.
Repeatedly splitting composite factors gives
Grouping equal primes produces exponent form:
The exponent means that factor appears three times; the exponent means that factor appears twice.
The Fundamental Theorem of Arithmetic
The Fundamental Theorem of Arithmetic states:
> Every integer greater than can be written as a product of primes, and that factorization is unique apart from the order of the factors.
Thus
and
are the same prime factorization in different orders. There is no genuinely different prime inventory for .
The theorem has two claims:
1. Existence: repeated splitting eventually reaches primes because every split uses smaller positive integers.
2. Uniqueness: two prime products for the same integer must contain the same primes with the same exponents.
The first claim echoes Chapter 7's well-founded recursion: a positive integer cannot keep decreasing forever.
Counting positive divisors from a prime factorization
Suppose
where the are distinct primes and the are positive integers.
Every positive divisor chooses an exponent for each prime:
There are choices for prime . The product principle from Chapter 6 gives the divisor-count formula
The symbol denotes the number of positive divisors of .
For
we obtain
Split composite number blocks into factor-tree branches until every leaf is prime. The forge continuously audits unfinished composite leaves, collapses the tree into an exponent inventory, and generates divisors by choosing exponent coordinates rather than listing them blindly.
Section bridge
Prime factorizations can reveal common factors, but factoring large numbers is expensive. Section 8.2 develops Euclid's algorithm, which finds the greatest common divisor by repeated remainder reduction without factoring either input.