Prime Numbers & Divisibility

The atoms of arithmetic — primes are the building blocks of all integers.

Prime Numbers

XTwS7j9EdLhlZ6RNbi9tmbZKpV1JLawoR9mF2sDLrE/ApMT14z2eHJGRAFb/6s0TfdyGkdAwZAH0p4SkdkGmAEbPuVhONZIpUirgE2ygczsJAxctpQQ6dudldrPrCSTDKLew8R/yhgue0BNrsHlYsKjzLpzVmNpPxFVANzWO/kzzZML6wOvJy0bKnLJjb7uceRI8i6Ydzmh45Ccw+ePcUVpZneChvdwJlHCQUB8bs1RoO8HDZecgs+cC6dcGER72oF0zWUlgGrKMMybs1hRi2q66EB4cuOI6KNDKmtOea6yJfXTWYIAZrpC//zmY837vIp1MjgzUoLrJl6bLOiCbsA99NR0vSvU8IXnONsGyAT+hGt0uAfhTq+T4dpywXmEo/IRMtSsulaHrXeo3OMPRErXZ7PmHx3NnFEL2nfeOyvsh23KvJ5AAjK0BQc79HfF2FL9YzSulkOFyaEUeoVaNXbei8SDbuAUc7JzNqlmaU4zjBIhUI9MRBn7BBK4EVEqLKSyL40zV9oz1QYvmmVUepj87qlu+i9j8zoGGUJWVRYzHbc1wpeY0vhLd/MmkGiTh4k0N+4PT9pTiD9GQ5CC8FjJd/DT/61a+QvhZ3gHpXJrQEw9beyZGBcEqZNjNeidgsPqdLu7ZsTZnqDEiEP/l7XBbv8o+/fzrm6z2hHMUZsZKyOEsstQHRclrVTs+ETkEkSkATzpBYDkNegTyGSaf1q1WxUky6s7d4FggQm6DdNE

A prime p > 1 has exactly two divisors: 1 and itself. The first primes: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, …

2 is the only even prime — every even number > 2 is divisible by 2. To test if n is prime, check divisibility by primes up to √n (why? if n = a·b, one factor must be ≤ √n).

Primes are the foundation of modern cryptography and connect deeply to factoring in algebra.

Fundamental Theorem of Arithmetic

Every integer n > 1 has a unique prime factorization:
n = p₁^a₁ · p₂^a₂ · … · pₖ^aₖ
EmQcyBghuGdcP65Uz83HS3SWoKcQuvrntVuXyuUQd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OZgc3VLp2hEE1krQNegHNwY9d9V3vtubvLVu0Xc0ssRa3P2iyQHdS0EU04Oi4Jaham7kBdZqqLButHVz+PQnoju27Jgqzw5r1+A8kgwIusoEMLVQjcSA4+5ZrAH1cofnzXoJFGdgTt0HeyGlIu5x0oqS5HCc5P7zn/Wo25BjZt4JuqxFwWGvDpy/mjX5o2BhGDdmNvkAC87o2tvFa6Jf3Mm5mhykFNPmPQ0T31s+SZecPkyZ/8JX/TBCgnVSfzNseBMDY0lvErbJWUo/qJlrviO9pFWJd3kPnwEy5Cwtvxr2DbkT8GtpMTs1DEuNWvgbOQznqsRCY2z4aqERyNP6CAyxxmmksQclwPGdO+umuxZ0zvd8GNghXuc6n1bXqb7lDTg5g+dURJIdcl

360 ÷ 2 = 180 → 180 ÷ 2 = 90 → 90 ÷ 2 = 45 → 45 ÷ 3 = 15 → 15 ÷ 3 = 5 → 5 ÷ 5 = 1

Divisors of 360: (3+1)(2+1)(1+1) = 24 divisors

GCD & LCM

GCD(a, b) = product of common primes with min exponents
LCM(a, b) = product of all primes with max exponents
a · b = GCD(a, b) · LCM(a, b)

Euclidean Algorithm computes GCD efficiently: GCD(a, b) = GCD(b, a mod b). This is one of the oldest algorithms — and it's essential in modular arithmetic for finding modular inverses.

The Sieve of Eratosthenes

To find all primes ≤ n: start with 2, mark all multiples of 2, next unmarked (3), mark all multiples of 3, continue to √n. The remaining unmarked numbers are prime. Complexity: O(n log log n).

Distribution of Primes

The Prime Number Theorem: π(n) ≈ n/ln(n), where π(n) counts primes ≤ n. This connects primes to logarithmic functions and limits. There are infinitely many primes (Euclid's proof by contradiction is one of the most elegant in mathematics).

Open problems: the Twin Prime Conjecture (infinitely many primes p where p+2 is also prime), Goldbach's Conjecture (every even n > 2 is the sum of two primes), and the Riemann Hypothesis (about the precise distribution of primes).