Skip to content

Number Theory

Theorem 1.1 (Division Algorithm). For any integers aa and bb with b>0b > 0There exist unique Integers qq and rr such that a=bq+ra = bq + r with 0≤r<b0 \leq r \lt b.

Proof. Consider the set S=a−bk:k∈Z, a−bk≥0S = \\{a - bk : k \in \mathbb{Z},\ a - bk \geq 0\\}. This set is non-empty (by the Archimedean property, choosing kk sufficiently negative). By the well-ordering principle, SS has a least element r=a−bqr = a - bq. If r≥br \geq bThen r−b=a−(q+1)b∈Sr - b = a - (q+1)b \in S with r−b<rr - b \lt rContradicting minimality. So 0≤r<b0 \leq r \lt b. For uniqueness, if a=bq1+r1=bq2+r2a = bq_1 + r_1 = bq_2 + r_2Then b(q1−q2)=r2−r1b(q_1 - q_2) = r_2 - r_1. Since ∣r2−r1∣<b|r_2 - r_1| \lt bWe must Have q1=q2q_1 = q_2 and r1=r2r_1 = r_2. ■\blacksquare

We write d∣ad \mid a (read ”dd divides aa”) if there exists k∈Zk \in \mathbb{Z} with a=dka = dk.

Proposition 1.2. For all a,b,c∈Za, b, c \in \mathbb{Z}:

  1. If a∣ba \mid b and b∣cb \mid cThen a∣ca \mid c.
  2. If a∣ba \mid b and a∣ca \mid cThen a∣(mb+nc)a \mid (mb + nc) for all m,n∈Zm, n \in \mathbb{Z}.
  3. If a∣ba \mid b and b≠0b \neq 0Then ∣a∣≤∣b∣|a| \leq |b|.
  4. a∣0a \mid 0 for all aaBut 0∣a0 \mid a only when a=0a = 0.

Proof. (1) a∣ba \mid b means b=akb = ak and b∣cb \mid c means c=bℓ=akℓc = b\ell = ak\ellSo a∣ca \mid c. (2) a∣ba \mid b means b=akb = ak and a∣ca \mid c means c=aℓc = a\ellSo mb+nc=a(mk+nℓ)mb + nc = a(mk + n\ell). (3) a∣ba \mid b means b=akb = akSo ∣b∣=∣a∣⋅∣k∣≥∣a∣|b| = |a| \cdot |k| \geq |a|. (4) 0=a⋅00 = a \cdot 0So a∣0a \mid 0. If 0∣a0 \mid aThen a=0⋅k=0a = 0 \cdot k = 0. ■\blacksquare

1.3 Worked Examples of the Division Algorithm

Section titled “1.3 Worked Examples of the Division Algorithm”

Problem. Apply the division algorithm to write −237=14q+r-237 = 14q + r with 0≤r<140 \leq r \lt 14.

Solution

We compute 237÷14=16.93…237 \div 14 = 16.93\ldotsSo 14⋅16=22414 \cdot 16 = 224 and 14⋅17=238>23714 \cdot 17 = 238 > 237. Thus for positive 237237: q=16q = 16, r=13r = 13Giving 237=14⋅16+13237 = 14 \cdot 16 + 13.

For a=−237a = -237: we need qq such that r=−237−14qr = -237 - 14q satisfies 0≤r<140 \leq r \lt 14. −237=14(−17)+1-237 = 14(-17) + 1: check 14⋅(−17)=−23814 \cdot (-17) = -238And −238+1=−237-238 + 1 = -237. Here q=−17q = -17 and r=1r = 1 with 0≤1<140 \leq 1 \lt 14. ■\blacksquare

Problem. Find all integers nn such that n≡3(mod7)n \equiv 3 \pmod{7} and n≡2(mod5)n \equiv 2 \pmod{5}.

Solution

From n≡3(mod7)n \equiv 3 \pmod{7}We have n=7k+3n = 7k + 3 for some k∈Zk \in \mathbb{Z}. Substituting into n≡2(mod5)n \equiv 2 \pmod{5}: 7k+3≡2(mod5)7k + 3 \equiv 2 \pmod{5}So 7k≡−1≡4(mod5)7k \equiv -1 \equiv 4 \pmod{5}Giving 2k≡4(mod5)2k \equiv 4 \pmod{5}Hence k≡2(mod5)k \equiv 2 \pmod{5}.

So k=5m+2k = 5m + 2And n=7(5m+2)+3=35m+17n = 7(5m + 2) + 3 = 35m + 17. The solutions are n≡17(mod35)n \equiv 17 \pmod{35}. ■\blacksquare

1.4 Uniqueness of the Greatest Common Divisor

Section titled “1.4 Uniqueness of the Greatest Common Divisor”

Theorem 1.3. Let a,b∈Za, b \in \mathbb{Z}Not both zero. The greatest common divisor of aa and bb Exists and is unique.

Proof. The set D=d∈N:d∣a and d∣b"D = \\{d \in \mathbb{N} : d \mid a \mathrm{\ and\ } d \mid b\\}" is non-empty since ∣a∣∈D|a| \in D (if a≠0a \neq 0) or ∣b∣∈D|b| \in D (if b≠0b \neq 0). By the well-ordering principle, DD has A least element gg. We claim g=gcd⁡(a,b)g = \gcd(a, b). By definition g∣ag \mid a and g∣bg \mid b. If c∣ac \mid a And c∣bc \mid bThen c≤∣c∣≤gc \leq |c| \leq g (since gg is the least positive common divisor). For Uniqueness: if g1g_1 and g2g_2 are both greatest common divisors, then g1∣g2g_1 \mid g_2 and g2∣g1g_2 \mid g_1 So g1=g2g_1 = g_2 (since both are positive). ■\blacksquare

Definition. The least common multiple of positive integers aa and bbWritten lcm(a,b)\mathrm{lcm}(a, b)Is the smallest positive integer mm such that a∣ma \mid m and b∣mb \mid m.

Theorem 1.4 (GCD—LCM Identity). For all positive integers aa and bb:

gcd⁡(a,b)⋅lcm(a,b)=ab\gcd(a, b) \cdot \mathrm{lcm}(a, b) = ab

Proof. Write a=∏i=1kpiαia = \prod_{i=1}^k p_i^{\alpha_i} and b=∏i=1kpiβib = \prod_{i=1}^k p_i^{\beta_i} where αi,βi≥0\alpha_i, \beta_i \geq 0. Then gcd⁡(a,b)=∏i=1kpimin⁡(αi,βi)\gcd(a, b) = \prod_{i=1}^k p_i^{\min(\alpha_i, \beta_i)} and lcm(a,b)=∏i=1kpimax⁡(αi,βi)\mathrm{lcm}(a, b) = \prod_{i=1}^k p_i^{\max(\alpha_i, \beta_i)}. Since min⁡(αi,βi)+max⁡(αi,βi)=αi+βi\min(\alpha_i, \beta_i) + \max(\alpha_i, \beta_i) = \alpha_i + \beta_i for each iiWe have:

gcd⁡(a,b)⋅lcm(a,b)=∏i=1kpiαi+βi=ab■\gcd(a,b) \cdot \mathrm{lcm}(a,b) = \prod_{i=1}^k p_i^{\alpha_i + \beta_i} = ab \qquad \blacksquare

Proposition 1.5. For all positive integers a,ba, b:

  1. lcm(a,b)=ab/gcd⁡(a,b)\mathrm{lcm}(a, b) = ab / \gcd(a, b).
  2. gcd⁡(a,lcm(b,c))=lcm(gcd⁡(a,b),gcd⁡(a,c))\gcd(a, \mathrm{lcm}(b, c)) = \mathrm{lcm}(\gcd(a, b), \gcd(a, c)).

Problem. Compute lcm(252,105)\mathrm{lcm}(252, 105) and verify the gcd—lcm identity.

Solution

First, gcd⁡(252,105)\gcd(252, 105). Using the Euclidean algorithm: 252=2⋅105+42252 = 2 \cdot 105 + 42, 105=2⋅42+21105 = 2 \cdot 42 + 21, 42=2⋅21+042 = 2 \cdot 21 + 0. So gcd⁡(252,105)=21\gcd(252, 105) = 21.

By the identity: lcm(252,105)=252⋅105/21=252⋅5=1260\mathrm{lcm}(252, 105) = 252 \cdot 105 / 21 = 252 \cdot 5 = 1260.

Verification: 1260/252=51260 / 252 = 5 and 1260/105=121260 / 105 = 12Both integers. ■\blacksquare

ConceptDefinitionExample
Division Alga=bq+ra = bq + r, 0≤r<b0 \leq r < b−237=14(−17)+1-237 = 14(-17) + 1
gcd⁡(a,b)\gcd(a,b)Largest dd with d∣ad\mid a and d∣bd\mid bgcd⁡(252,105)=21\gcd(252,105)=21
lcm\mathrm{lcm}Smallest mm with a∣ma\mid m and b∣mb\mid mlcm(252,105)=1260\mathrm{lcm}(252,105)=1260
Euclidean AlgRepeated division to find gcd⁡\gcd252=2⋅105+42252 = 2\cdot105 + 42, …
Bezout’s Identity∃x,y:ax+by=gcd⁡(a,b)\exists x,y: ax + by = \gcd(a,b)252x+105y=21252x + 105y = 21
  • Forgetting the remainder must be non-negative. For negative aa, the division algorithm still requires 0≤r<b0 \leq r < b, which may mean qq is not simply a/ba/b.
  • Confusing “divides” with divisibility by zero. a∣0a \mid 0 is true for all a≠0a \neq 0, but 0∣a0 \mid a is false unless a=0a = 0 itself.
  • Assuming gcd and lcm are defined for negative numbers. The gcd is always taken as positive; gcd⁡(a,b)=gcd⁡(∣a∣,∣b∣)\gcd(a,b) = \gcd(|a|,|b|).
  • Thinking the gcd-lcm identity works for more than two numbers. For three numbers, gcd⁡(a,b,c)⋅lcm(a,b,c)≠abc\gcd(a,b,c) \cdot \mathrm{lcm}(a,b,c) \neq abc in general.
  • Cryptography: RSA encryption relies on the fact that computing gcd⁡\gcd is easy (Euclidean algorithm) but factoring large numbers is hard. The Carmichael function λ(n)\lambda(n) depends on lcm of prime-power factors.
  • Scheduling: The lcm determines when periodic events coincide. If bus A runs every 12 minutes and bus B every 18 minutes, they coincide every lcm(12,18)=36\mathrm{lcm}(12,18) = 36 minutes.
  • Computer arithmetic: The Euclidean algorithm efficiently computes modular inverses used in the extended Euclidean algorithm for RSA key generation.
  • Diophantine equations: The linear Diophantine equation ax+by=cax + by = c has integer solutions iff gcd⁡(a,b)∣c\gcd(a,b) \mid c, and the solutions are parameterised by the lcm-related step size.