Lesson 1: Divisibility & Prime Numbers

What You'll Learn

This lesson introduces the foundational ideas of number theory: divisibility, the Division Algorithm, prime and composite numbers, and basic properties of primes that will be used throughout the course.
Definition

Divisibility

Let a,bZa, b \in \mathbb{Z} with a0a \neq 0. We say aa divides bb (written aba \mid b) if there exists an integer kk such that:

b=akb = ak

We also say aa is a divisor (or factor) of bb, and bb is a multiple of aa.

If aa does not divide bb, we write aba \nmid b.

Examples: 3123 \mid 12 (since 12=3412 = 3 \cdot 4), but 5125 \nmid 12.
Let a,b,cZa, b, c \in \mathbb{Z}.

1. Reflexivity: aaa \mid a for all a0a \neq 0.
2. Transitivity: If aba \mid b and bcb \mid c, then aca \mid c.
3. Linearity: If aba \mid b and aca \mid c, then a(bx+cy)a \mid (bx + cy) for all x,yZx, y \in \mathbb{Z}.
4. Comparison: If aba \mid b and b0b \neq 0, then ab|a| \leq |b|.
5. If aba \mid b and bab \mid a, then a=±ba = \pm b.
Divisibility is transitive and respects linear combinations — key facts used in every proof.
Ex

Example — Proving a Divisibility Statement

Prove: If 6n6 \mid n, then 3n3 \mid n.
Solution Steps
For any integers aa and bb with b>0b > 0, there exist unique integers qq (quotient) and rr (remainder) such that:

a=bq+r,0r<ba = bq + r, \quad 0 \leq r < b

We write q=a÷bq = a \div b (integer quotient) and r=amodbr = a \bmod b (remainder).

Example: a=23,b=5a = 23, b = 5: 23=54+323 = 5 \cdot 4 + 3, so q=4,r=3q = 4, r = 3.
Every integer can be uniquely expressed as bq + r with 0 ≤ r < b. This is the basis of modular arithmetic.
Ex

Example — Division Algorithm

Find the quotient and remainder when a=17a = -17 is divided by b=5b = 5.
Solution Steps
Definition

Prime & Composite Numbers

An integer p>1p > 1 is prime if its only positive divisors are 11 and pp itself.

An integer n>1n > 1 that is not prime is called composite — it can be written as n=abn = ab where 1<a,b<n1 < a, b < n.

By convention, 11 is neither prime nor composite.

The first few primes: 2,3,5,7,11,13,17,19,23,29,31,2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, \ldots

Note: 22 is the only even prime.
Theorem (Euclid, c. 300 BCE): There are infinitely many prime numbers.

Proof (by contradiction): Suppose there are only finitely many primes: p1,p2,,pnp_1, p_2, \ldots, p_n. Consider:
N=p1p2pn+1N = p_1 p_2 \cdots p_n + 1
NN is not divisible by any pip_i (since dividing gives remainder 11). So either NN is prime, or NN has a prime factor not in our list. Either way, we have a prime not in the list — contradiction. ∎
One of the most elegant proofs in mathematics: multiply all known primes and add 1 to get a contradiction.
Every integer n>1n > 1 has at least one prime divisor. Moreover, if nn is composite, then nn has a prime divisor pnp \leq \sqrt{n}.

Proof of the second part: If n=abn = ab with 1<ab<n1 < a \leq b < n, then a2ab=na^2 \leq ab = n, so ana \leq \sqrt{n}. Since a>1a > 1, aa has a prime divisor panp \leq a \leq \sqrt{n}. ∎

This gives us a primality test: to check if nn is prime, only test divisors up to n\sqrt{n}.
To check primality of n, you only need to check prime divisors up to √n.
Ex

Example — Testing Primality

Is 9797 prime?
Solution Steps

The Sieve of Eratosthenes

To find all primes up to NN:

1. List all integers from 22 to NN.
2. Start with the smallest unmarked number (22). Circle it as prime.
3. Cross out all multiples of 22 (except 22 itself).
4. Move to the next unmarked number (33). Circle it.
5. Cross out all multiples of 33.
6. Repeat until you've processed all primes up to N\sqrt{N}.
7. All remaining unmarked numbers are prime.

This ancient algorithm (c. 240 BCE) is remarkably efficient and still used in practice.
?
Practice Problem
easy
Find the quotient and remainder when 4747 is divided by 88. What is the remainder?
?
Practice Problem
easy
Is 143143 prime or composite?
?
Practice Problem
medium
If aba \mid b and aca \mid c, does a(2b+3c)a \mid (2b + 3c)?
?
Practice Problem
medium
In Euclid's proof, if we take primes {2,3,5}\{2, 3, 5\} and form N=235+1=31N = 2 \cdot 3 \cdot 5 + 1 = 31, is NN prime?
1 / 5