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 0r<b0 \leq r \lt b.

Proof. Consider the set S=abk:kZ, abk0S = \\{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=abqr = a - bq. If rbr \geq bThen rb=a(q+1)bSr - b = a - (q+1)b \in S with rb<rr - b \lt rContradicting minimality. So 0r<b0 \leq r \lt b. For uniqueness, if a=bq1+r1=bq2+r2a = bq_1 + r_1 = bq_2 + r_2Then b(q1q2)=r2r1b(q_1 - q_2) = r_2 - r_1. Since r2r1<b|r_2 - r_1| \lt bWe must Have q1=q2q_1 = q_2 and r1=r2r_1 = r_2. \blacksquare

We write dad \mid a (read ”dd divides aa”) if there exists kZk \in \mathbb{Z} with a=dka = dk.

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

  1. If aba \mid b and bcb \mid cThen aca \mid c.
  2. If aba \mid b and aca \mid cThen a(mb+nc)a \mid (mb + nc) for all m,nZm, n \in \mathbb{Z}.
  3. If aba \mid b and b0b \neq 0Then ab|a| \leq |b|.
  4. a0a \mid 0 for all aaBut 0a0 \mid a only when a=0a = 0.

Proof. (1) aba \mid b means b=akb = ak and bcb \mid c means c=b=akc = b\ell = ak\ellSo aca \mid c. (2) aba \mid b means b=akb = ak and aca \mid c means c=ac = a\ellSo mb+nc=a(mk+n)mb + nc = a(mk + n\ell). (3) aba \mid b means b=akb = akSo b=aka|b| = |a| \cdot |k| \geq |a|. (4) 0=a00 = a \cdot 0So a0a \mid 0. If 0a0 \mid aThen a=0k=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 0r<140 \leq r \lt 14.

Solution

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

For a=237a = -237: we need qq such that r=23714qr = -237 - 14q satisfies 0r<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 01<140 \leq 1 \lt 14. \blacksquare

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

Solution

From n3(mod7)n \equiv 3 \pmod{7}We have n=7k+3n = 7k + 3 for some kZk \in \mathbb{Z}. Substituting into n2(mod5)n \equiv 2 \pmod{5}: 7k+32(mod5)7k + 3 \equiv 2 \pmod{5}So 7k14(mod5)7k \equiv -1 \equiv 4 \pmod{5}Giving 2k4(mod5)2k \equiv 4 \pmod{5}Hence k2(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 n17(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,bZa, b \in \mathbb{Z}Not both zero. The greatest common divisor of aa and bb Exists and is unique.

Proof. The set D=dN:da and db"D = \\{d \in \mathbb{N} : d \mid a \mathrm{\ and\ } d \mid b\\}" is non-empty since aD|a| \in D (if a0a \neq 0) or bD|b| \in D (if b0b \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 gag \mid a and gbg \mid b. If cac \mid a And cbc \mid bThen ccgc \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 g1g2g_1 \mid g_2 and g2g1g_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 ama \mid m and bmb \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,βi0\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=2105+42252 = 2 \cdot 105 + 42, 105=242+21105 = 2 \cdot 42 + 21, 42=221+042 = 2 \cdot 21 + 0. So gcd(252,105)=21\gcd(252, 105) = 21.

By the identity: lcm(252,105)=252105/21=2525=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, 0r<b0 \leq r < b237=14(17)+1-237 = 14(-17) + 1
gcd(a,b)\gcd(a,b)Largest dd with dad\mid a and dbd\mid bgcd(252,105)=21\gcd(252,105)=21
lcm\mathrm{lcm}Smallest mm with ama\mid m and bmb\mid mlcm(252,105)=1260\mathrm{lcm}(252,105)=1260
Euclidean AlgRepeated division to find gcd\gcd252=2105+42252 = 2\cdot105 + 42, …
Bezout’s Identityx,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 0r<b0 \leq r < b, which may mean qq is not simply a/ba/b.
  • Confusing “divides” with divisibility by zero. a0a \mid 0 is true for all a0a \neq 0, but 0a0 \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.