1.2 Number Theory, Divisibility, Primes & Modular Arithmetic
Key Takeaways
- The Division Algorithm guarantees that for any integers a and b with b > 0, there exist unique integers q and r such that a = qb + r with 0 ≤ r < b; negative dividends require r ≥ 0, which forces the quotient to round down toward negative infinity.
- The Fundamental Theorem of Arithmetic establishes unique prime factorization for every integer n > 1, providing prime-exponent representations for gcd(a, b) and lcm(a, b) such that gcd(a, b) · lcm(a, b) = |ab|.
- The Euclidean Algorithm computes gcd(a, b) via successive remainders in logarithmic time O(log(min(a, b))), while the Extended Euclidean Algorithm computes Bézout coefficients x, y ∈ ℤ such that ax + by = gcd(a, b).
- A linear Diophantine equation ax + by = c has integer solutions if and only if gcd(a, b) divides c, generating an infinite family of integer solutions parameterized by t ∈ ℤ once a particular solution (x₀, y₀) is known.
- Modular congruence a ≡ b (mod m) preserves addition, subtraction, and multiplication, but division requires multiplying by the modular inverse a⁻¹, which exists if and only if gcd(a, m) = 1.
1.2 Number Theory, Divisibility, Primes & Modular Arithmetic
Number theory provides secondary mathematics educators with a deep repertoire of algebraic structures, discrete algorithms, and problem-solving contexts. From divisibility rules and prime factorization in middle school to cryptographic ciphers (such as RSA) and modular congruences in advanced coursework, the principles of number theory anchor algebraic fluency in discrete mathematical reasoning.
1. The Division Algorithm & Divisibility Foundations
Let $a, b \in \mathbb{Z}$ with $b \ne 0$. We say that $b$ divides $a$ (written $b \mid a$) if there exists an integer $k \in \mathbb{Z}$ such that $a = bk$. When $b$ does not divide $a$, the fundamental division structure of the integers is governed by the Division Algorithm:
Theorem (The Division Algorithm): Given integers $a$ (dividend) and $b$ (divisor) with $b > 0$, there exist unique integers $q$ (quotient) and $r$ (remainder) such that:
The Negative Dividend Pedagogical Trap
A widespread point of confusion in secondary mathematics arises when dividing a negative integer by a positive integer. Consider dividing $-38$ by $7$:
- Common Student Error: Many students perform truncation division (as seen in standard handheld calculators): $-38 \div 7 = -5.428\dots \implies q = -5$. They write $-38 = (-5)(7) - 3$, reporting a remainder of $-3$. This violates the definition, which strictly requires $0 \le r < b$.
- Correct Mathematical Procedure: The quotient must round down toward $-\infty$, giving $q = -6$. Then: Here $q = -6$ and $r = 4$, satisfying $0 \le 4 < 7$. In modular arithmetic, this yields $-38 \equiv 4 \pmod 7$.
- Teaching Strategy: Have students visualize integer division on a number line. To represent $-38$ using jumps of size $7$ from the origin, taking $5$ steps left reaches $-35$, which is not far enough to the left to add a positive remainder. Taking $6$ steps left reaches $-42$; from $-42$, one must step $+4$ to the right to land on $-38$.
2. Prime Factorization, GCD, and LCM
A prime number is an integer $p > 1$ whose only positive divisors are $1$ and $p$. Integers $n > 1$ that are not prime are composite.
The Fundamental Theorem of Arithmetic (Unique Factorization)
Every integer $n > 1$ can be expressed uniquely as a product of prime powers: where $p_1 < p_2 < \dots < p_k$ are distinct primes and $e_i \ge 1$, up to the order of factors.
The uniqueness proof hinges on Euclid's Lemma: if a prime $p$ divides a product $ab$, then $p \mid a$ or $p \mid b$. This lemma distinguishes prime elements from arbitrary composite numbers.
Prime Testing Strategy
To test whether an integer $n > 1$ is prime, one only needs to test prime divisors $p \le \lfloor\sqrt{n}\rfloor$.
- Proof: Suppose $n$ is composite. Then $n = ab$ with $1 < a \le b$. If both $a > \sqrt{n}$ and $b > \sqrt{n}$, then $ab > \sqrt{n}\sqrt{n} = n$, a contradiction. Therefore, the smaller factor satisfies $a \le \sqrt{n}$. By the Fundamental Theorem of Arithmetic, $a$ has at least one prime divisor $p \le a \le \sqrt{n}$.
GCD, LCM, and Their Universal Identity
For integers $a = \prod p_i^{e_i}$ and $b = \prod p_i^{f_i}$, the greatest common divisor $\gcd(a, b)$ and least common multiple $\operatorname{lcm}(a, b)$ are: Because $\min(e_i, f_i) + \max(e_i, f_i) = e_i + f_i$ for all real exponents, we obtain the universal identity:
3. The Euclidean & Extended Euclidean Algorithms
Factoring large integers into primes is computationally inefficient. The Euclidean Algorithm computes $\gcd(a, b)$ in logarithmic time ($O(\log(\min(a, b)))$ steps by Lamé's Theorem) by applying the recurrence:
Bézout's Identity and the Extended Euclidean Algorithm
Bézout's Identity asserts that $\gcd(a, b)$ is the smallest positive integer that can be expressed as an integer linear combination of $a$ and $b$: The integers $x$ and $y$ are called Bézout coefficients.
Worked Example: Compute $\gcd(138, 42)$ and find its Bézout representation
Forward Euclidean Algorithm:
- $138 = 3(42) + 12$
- $42 = 3(12) + 6$
- $12 = 2(6) + 0$ The last non-zero remainder is 6, so $\gcd(138, 42) = 6$.
Reverse Extended Euclidean Algorithm (Back-Substitution):
- From equation (2): $6 = 42 - 3(12)$
- From equation (1): $12 = 138 - 3(42)$
- Substitute $12$ into the expression for $6$: Rewriting: $138(-3) + 42(10) = 6$. The Bézout coefficients are $x = -3$ and $y = 10$.
4. Modular Congruence & Linear Diophantine Equations
Two integers $a$ and $b$ are congruent modulo $m$ ($m \in \mathbb{Z}^+$), written $a \equiv b \pmod m$, if $m \mid (a - b)$. Modular congruence partitions $\mathbb{Z}$ into $m$ equivalence classes $\mathbb{Z}_m = {[0], [1], \dots, [m-1]}$.
Algebraic Compatibility and the Cancellation Caveat
If $a_1 \equiv b_1 \pmod m$ and $a_2 \equiv b_2 \pmod m$, then:
- $a_1 \pm a_2 \equiv b_1 \pm b_2 \pmod m$
- $a_1 a_2 \equiv b_1 b_2 \pmod m$
[!CAUTION] The Modular Cancellation Rule: One cannot divide across congruences arbitrarily. If $ac \equiv bc \pmod m$, then: Canceling $c$ without changing the modulus is valid if and only if $\gcd(c, m) = 1$.
Modular Multiplicative Inverses
The linear congruence $ax \equiv 1 \pmod m$ has a solution $x = a^{-1}$ if and only if $\gcd(a, m) = 1$. By Bézout's identity, $\gcd(a, m) = 1 \implies ax + my = 1$, which reduces modulo $m$ to $ax \equiv 1 \pmod m$.
- If $m = p$ is prime, Fermat's Little Theorem ($a^{p-1} \equiv 1 \pmod p$ for $p \nmid a$) gives the inverse explicitly as $a^{-1} \equiv a^{p-2} \pmod p$.
Linear Diophantine Equations: $ax + by = c$
A linear Diophantine equation seeks integer solutions $(x, y) \in \mathbb{Z}^2$.
- Solvability Criterion: Solutions exist if and only if $d = \gcd(a, b)$ divides $c$.
- General Solution Formula: If $(x_0, y_0)$ is a particular solution found via the Extended Euclidean Algorithm, all integer solutions are given by:
5. Pedagogical Scenarios & Diagnosing Misconceptions
Classroom Context: Calendar Arithmetic (Modulo 7)
Calendar systems provide a natural anchor for modular arithmetic. Days of the week map to residue classes modulo 7: Sunday = 0, Monday = 1, ..., Saturday = 6.
- Scenario: If today is Wednesday (day 3), what day of the week will it be in $500$ days?
- Solution: Compute $(3 + 500) \pmod 7$. Using the Division Algorithm: $503 = 71(7) + 6$. Since $503 \equiv 6 \pmod 7$, the day will be Saturday.
Misconception Analysis: Illegal Cancellation in Congruences
When asked to solve $6x \equiv 18 \pmod 8$, students frequently divide both sides by 6 and conclude $x \equiv 3 \pmod 8$.
- Teacher Diagnostic: Dividing by $c = 6$ requires dividing the modulus by $\gcd(6, 8) = 2$, yielding $x \equiv 3 \pmod 4$. In the original modulo 8 system, this produces two distinct residue solutions: $x \equiv 3 \pmod 8$ and $x \equiv 7 \pmod 8$. Dividing without altering the modulus omits half of the valid solution set.
An accomplished teacher guides students to solve the linear congruence 7x ≡ 5 (mod 11). What is the smallest positive integer value of x satisfying this congruence?
When applying the Division Algorithm a = qb + r to divide a = -43 by b = 7, what are the unique integer values of the quotient q and remainder r?
A student attempts to solve the linear congruence 6x ≡ 18 (mod 8) by dividing both sides by 6, concluding that x ≡ 3 (mod 8). How should the teacher assess this work and guide the student?