7.2 Divisibility, Primes, and the Euclidean Algorithm

Key Takeaways

  • The Division Algorithm guarantees unique quotient and remainder integers a = bq + r with 0 <= r < b, establishing the Euclidean structure of the integers.
  • The Euclidean algorithm efficiently computes gcd(a, b), while the Extended Euclidean algorithm determines Bézout coefficients satisfying 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 solutions stepped by b/gcd(a,b) and -a/gcd(a,b).
  • The Fundamental Theorem of Arithmetic guarantees unique prime factorization, yielding the duality identity gcd(a, b) * lcm(a, b) = |ab|, while the Prime Number Theorem establishes that the prime-counting function satisfies pi(x) ~ x / ln(x).
Last updated: September 2026

7.2 Divisibility, Primes, and the Euclidean Algorithm

Divisibility on the GRE Mathematics Subject Test focuses on the Euclidean algorithm, Bézout's identity, linear Diophantine equations, and prime distribution. Mastery of greatest common divisors and Diophantine solutions is vital for speed.


Divisibility and the Division Algorithm in $\mathbb{Z}$

For integers $a, b \in \mathbb{Z}$ ($a \neq 0$), $a$ divides $b$ ($a \mid b$) if $b = ak$ for some $k \in \mathbb{Z}$.

  • Linearity: $d \mid a$ and $d \mid b \implies d \mid (ax + by)$ for all $x, y \in \mathbb{Z}$.
  • Transitivity: $a \mid b$ and $b \mid c \implies a \mid c$.
  • Cancellation: $a \mid b \iff ac \mid bc$ for $c \neq 0$.

Division Algorithm

For $a, b \in \mathbb{Z}$ with $b > 0$, there exist unique integers $q, r$ such that: a=bq+rwith0≤r<ba = bq + r \quad \text{with} \quad 0 \le r < b where $r = a \bmod b$.


Primes and the Fundamental Theorem of Arithmetic

An integer $p > 1$ is prime if its only positive divisors are $1$ and $p$; otherwise it is composite.

  • Euclid's Lemma: If prime $p \mid ab$, then $p \mid a$ or $p \mid b$.
  • Fundamental Theorem of Arithmetic: Every integer $n > 1$ factors uniquely into prime powers: n=∏i=1kpiai(ai≥1)n = \prod_{i=1}^k p_i^{a_i} \quad (a_i \ge 1)

GCD, LCM, and Duality

The greatest common divisor $\gcd(a, b)$ is the largest integer dividing both $a$ and $b$. If $\gcd(a, b) = 1$, they are coprime. The least common multiple $\operatorname{lcm}(a, b)$ is the smallest positive integer divisible by both. gcd⁡(a,b)=∏ipimin⁡(αi,βi),lcm⁡(a,b)=∏ipimax⁡(αi,βi)\gcd(a, b) = \prod_i p_i^{\min(\alpha_i, \beta_i)}, \qquad \operatorname{lcm}(a, b) = \prod_i p_i^{\max(\alpha_i, \beta_i)} Because $\min(\alpha, \beta) + \max(\alpha, \beta) = \alpha + \beta$: gcd⁡(a,b)⋅lcm⁡(a,b)=∣a⋅b∣\gcd(a, b) \cdot \operatorname{lcm}(a, b) = |a \cdot b|


The Euclidean Algorithm and Bézout's Identity

The Euclidean algorithm computes $\gcd(a, b)$ using $\gcd(a, b) = \gcd(b, a \bmod b)$. For $a > b > 0$, the last non-zero remainder is $\gcd(a, b)$.

Bézout's Identity

Non-zero $a, b \in \mathbb{Z}$ have integers $x, y$ satisfying: ax+by=gcd⁡(a,b)ax + by = \gcd(a, b) $\gcd(a, b)$ is the minimal positive integral combination of $a$ and $b$. Reversing division steps gives Bézout coefficients $x, y$.


Linear Diophantine Equations

For $ax + by = c$ with $a, b, c \in \mathbb{Z}$:

  1. Solvability: Integer solutions exist if and only if $d = \gcd(a, b) \mid c$.
  2. Particular Solution: Scale Bézout coefficients $ax_0' + by_0' = d$ by $c/d$: x0=x0′(c/d),y0=y0′(c/d)x_0 = x_0'(c/d), \qquad y_0 = y_0'(c/d)
  3. General Solution: For any integer $k \in \mathbb{Z}$: x=x0+(b/d)k,y=y0−(a/d)kx = x_0 + (b/d)k, \qquad y = y_0 - (a/d)k

Distribution of Primes and the Prime Number Theorem

Let $\pi(x)$ count primes $p \le x$.

  • Prime Number Theorem: $\lim_{x \to \infty} \frac{\pi(x)}{x / \ln x} = 1$, written $\pi(x) \sim \frac{x}{\ln x}$.
  • Asymptotics for $p_n$: $p_n \sim n \ln n$ as $n \to \infty$.
  • Bertrand's Postulate: For $n > 1$, there exists a prime $p$ with $n < p < 2n$.
  • Dirichlet's Theorem: If $\gcd(a, m) = 1$, the sequence $a + km$ contains infinitely many primes.

Summary Table: Divisibility and Equations

ConceptConditionFormula / Rule
Division Algorithm$b > 0$$a = bq + r$ with $0 \le r < b$
GCD-LCM Duality$a, b \neq 0$$\gcd(a, b) \cdot \operatorname{lcm}(a, b) =
Bézout's Identity$d = \gcd(a, b)$$ax + by = d$ solvable in $\mathbb{Z}$
Linear Diophantine$ax + by = c$Solvable iff $d \mid c$; steps: $b/d$ and $-a/d$
Prime Distribution$x \to \infty$$\pi(x) \sim \frac{x}{\ln x}$; $p_n \sim n \ln n$

Step-by-Step Worked Problem

Problem: Find all positive integer pairs $(x, y)$ satisfying $35x + 55y = 1000$.

Solution:

  1. $\gcd(55, 35)$: $55 = 1(35) + 20, 35 = 1(20) + 15, 20 = 1(15) + 5, 15 = 3(5) + 0 \implies d = 5$.
  2. Check solvability: $5 \mid 1000$. Divide by 5 to obtain $7x + 11y = 200$.
  3. Bézout coefficients for $7x + 11y = 1$: $1 = 4 - 3 = 2(4) - 7 = 2(11 - 7) - 7 = 2(11) - 3(7) \implies 7(-3) + 11(2) = 1$.
  4. Multiply by 200: $x_0 = -600, y_0 = 400$.
  5. General solution ($k \in \mathbb{Z}$): $x = -600 + 11k$, $y = 400 - 7k$.
  6. Require $x > 0$ and $y > 0$: $11k > 600 \implies k \ge 55$, and $7k < 400 \implies k \le 57$. Values $k \in {55, 56, 57}$ give pairs $(5, 15)$, $(16, 8)$, and $(27, 1)$.

GRE Exam Traps & Pitfalls

Trap 1: Applying GCD-LCM Duality to Three Integers $\gcd(a, b) \cdot \operatorname{lcm}(a, b) = |ab|$ holds strictly for two integers. For three integers, $\gcd(2, 2, 2) \cdot \operatorname{lcm}(2, 2, 2) = 4 \neq 8$.

Trap 2: Sign Mismatch in Diophantine General Solutions In $x = x_0 + (b/d)k$ and $y = y_0 - (a/d)k$, signs of $k$ must be opposite to keep $ax + by$ constant.

Trap 3: Forgetting to Divide Modulus by $d$ The parameter step size in general Diophantine solutions is $b/\gcd(a, b)$, not $b$.

Trap 4: Conflating $\pi(x)$ and $p_n$ $\pi(x) \sim x / \ln x$ counts primes up to $x$, whereas $p_n \sim n \ln n$ estimates the value of the $n$-th prime.

Loading diagram...
Euclidean Algorithm and Diophantine Equation Resolution
Test Your Knowledge

Which of the following is the complete set of integer solutions (x, y) to the linear Diophantine equation 42x + 15y = 24?

A
B
C
D
Test Your Knowledge

Let a and b be positive integers such that a * b = 151,200, gcd(a, b) = 12, and a < b. How many such ordered pairs (a, b) are possible?

A
B
C
D
Test Your Knowledge

According to the Prime Number Theorem, which asymptotic relation describes the n-th prime number p_n as n -> infinity?

A
B
C
D