Prime Numbers & Divisibility

i+J2I0vqDfI+y0Q3wyJ3fwcDb2OkkbJZIXeuH6UBwmhCz85nslrlcbKlON8Yy0PY+nzxmrGEc8Pl5bW5OnkUzzYWpgve4WVOySgPtpA0iVtzZ9O1d5NMD7r3oS4C+AVlqZgKecZhIiLtptBM9ETRcthVcjVXw6teTJUz5iaBtVzjLkXxr7vqGWqagJfYyECcogtu15PXmZi21J+bOFf/3bKHpWwdlnfWxCcBLdj031+8mzfl+bwo60FthZx/SY093P17HPALg3zSMMi26gFXP3OGPJ66fXBDgU+yXbUcP9zbeP2ThhspTmObBvTltn5SwetsYBN36Lsa7ZxblqiFfEXc8d4OWtlBjOkhAQH2+/2S1DgTODyU54IwgCia0p3sB9akRI+k37VDr+VmgzbYWOJkQplEKjc5BVjA5+nPOt/7XABu6TKSltPN0Yry8tqsC1amFrXqukB4YZAUSTZa6zyn87G5RVBNtVWGB/jyM8iwXUPnbJXexQgj9xJzrlkTEWWFJEhyJXGypTEv4Tono5KwPaVagpwjzLG1l/AZpMAczKmr3pfGGPGQXpAPHzQfPZv+ULvHbCY9fmHLiRIKZ5yn/75VgVXudgYNxIzTj0Gyf8v5VsDsMY2J9aCpRzqab2nBt8GsypSepvvN2Az4iCB30CsnjmoFJUeIi+eoLVzfBXzsAajWg51qsxA0wUafFBcNak69SWRBfPPoeAbogWVRs8F3eMRKVF+F57JNa9s1q32VuAJqAr3

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

Prime Numbers

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ₖ

Example: 360 = 2³ · 3² · 5

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

40aQvctay0hGHq8dGv3US8EfLH3Ph0D8gbtA43kP8cUgupcP8GMZ3B74vWj+vAK71XArnSAOQt1Bcd5LiD6ePdiVLkxDPuHKj21cI8Z1zSRBEbNKUiWBOQa2OGB7woRpnU+xvjbDEY4umHFHMZVji8f6C40vd1etDfms21ACFTema2Bk0fpDmX7YublL+NsX2S10p+ueGKJeGNGYcpjoTndVnYFJHspEid0M9PjIarnRTCK07nDsdvCTbG5MCswrK2g1eV+Qhz/m1ksde/2VVN5LXKf7woNZOcbrG+YzCOYl4bqxcWQ2CazI/3sBVCymho4FSiS0MrS83uT4mBnuDBlqdrvKdl44txVgvH0Rr8ryo9jAyMlESEbiNPs/jglEWhXwAqSPHgmRlob6Pvzx+ADgAbwXbeCh4fBoTvEs1KkgagZZo21z3/MnZ91bfZXB+186SMXyk604QtsBpDo1Yk/dLPNlKB8n/OIrw5Jw2u40gdRpIszlRBdVn/ZAmWxoPKcL5A5LgpP4LyxWUYfHxnTjCpafaYZwYNNoOPDQd2nAg5M7YUcABkoHBv5wFVwhY4yXGKnZdATmn2jnGZ5ZbKpIOJv33fBcI542UPaJ217p5OXnbv/ne5zD8pLOlrqT404j4ZJcrwFkMMusVRqb7mhMk20SZRmgtCcX7tueMtywo89k3fKJ4Bt+pfJfpyEyzGfUMVW8QYRVFTpmZBwstfF9g26HuMQPYU72L3PC9Ww5QELRWTUeA==

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).