3 | 12 and 12 | 3.
- 3 | 12 is true; 12 | 3 is false.
Divisibility, primes and the Fundamental Theorem of Arithmetic, GCD and LCM, the division algorithm, mod and congruences, then classical ciphers (Caesar, shift, affine), public-key cryptography with RSA, and the Diffie–Hellman key exchange.
Every original slide is shown unchanged. Yellow marks on a slide point to a numbered note: hover or tap a mark to jump to its note, and hover a note to see its marks. Questions tagged Past exam appeared on a real paper; Prediction questions are likely angles, not confirmed. Pick an answer to each question: a wrong pick tells you why it is wrong, so you can try again.
3 | 12 and 12 | 3.
If a | b and a | c then a | (b + c); if a | b then a | bc; if a | b and b | c then a | c.
Prime: integer > 1 whose only positive divisors are 1 and itself. 1 is NOT prime.
To show 101 is prime it is enough to test divisibility by primes up to:
gcd(a, b): largest integer dividing both. Relatively prime when gcd = 1.
gcd via prime factorizations: take the MIN power of each prime. lcm: take the MAX power.
gcd(a, b)·lcm(a, b) = a·b.
gcd(120, 500) =
If gcd(a, b) = 6 and ab = 360, lcm(a, b) =
Pairwise relatively prime: every pair has gcd 1.
Division algorithm: a = dq + r with 0 ≤ r < d; q = a div d, r = a mod d.
Trap The remainder is never negative: −11 div 3 = −4, −11 mod 3 = 1 (−11 = 3·(−4) + 1).
−11 mod 3 =
a ≡ b (mod m) when m | (a − b), i.e. a mod m = b mod m.
17 ≡ 5 (mod 6).
If a ≡ b and c ≡ d (mod m) then a + c ≡ b + d and ac ≡ bd (mod m).
Caesar (shift 3) encrypts "HI" as:
In an affine cipher f(p) = (ap + b) mod 26, a must satisfy:
RSA: n = pq, choose e with gcd(e, (p−1)(q−1)) = 1, d = e⁻¹ mod (p−1)(q−1).
RSA with p = 3, q = 11, e = 3. Find n, φ, and d.
n = 33, φ = (p−1)(q−1) = 20. d is the inverse of 3 mod 20: 3·7 = 21 ≡ 1, so d = 7.
In RSA, which key is kept secret?
Diffie–Hellman: agree on prime p and base g; Alice sends gᵃ mod p, Bob sends gᵇ mod p; both compute the shared key gᵃᵇ mod p.
p = 23, g = 5, a = 6, b = 15. Alice sends: