Euclid’s Infinitude of Primes

A P3-style, client‑side demo: we restate the theorem, explain Euclid’s one‑line proof, and run computational checks (sieve, Euclid constructions, and prime-count growth) to corroborate it.

1/ Answer Concise results

There are infinitely many prime numbers. Below we also compute evidence up to a large bound.

Bound checked
π(x) at bound
Largest prime ≤ bound
Max prime gap ≤ bound
π(x) / (x / ln x)

2/ Reason why Euclid’s proof (mathematical English)

Claim. There are infinitely many prime numbers.

Proof. Assume for contradiction that only finitely many primes exist. List them as p1p2 ≤ … ≤ pk. Define N = p1p2⋯pk + 1.

For each index i, division of N by pi leaves remainder 1; equivalently, N is not divisible by any of p1, …, pk.

Since N > 1, it has a prime divisor q. Because none of p1, …, pk divides N, this prime q is different from every prime on the list, contradicting the assumption that the list contained all primes. Therefore the set of primes is infinite. ∎

The reasoning does not search for “the last prime”: it shows that every finite list of primes can be extended.

3/ Checks Computed in the browser

Check 1 — Sieve sanity (tiny set)

Verify some known primes/composites are classified correctly.

primes ok: composites ok:
Check 2 — Euclid step on first k primes (k = 3…10)

For each k, build N = 1 + ∏i≤k pᵢ and find a prime factor q ∤ ∏ pᵢ.

k∏ pᵢ + 1 (N)found factor qq in first k?
Check 3 — π(10²)…π(10⁶) strictly increases
xπ(x)x/ln xratio
Check 4 — Sample Bertrand intervals contain a prime

For selected n, we confirm a prime exists in (n, 2n].

Check 5 — Random Euclid sets (mod‑1 property)

Random small prime sets S ⊂ {first 15 primes}; we verify (∏S + 1) mod p = 1 for all p∈S. This guarantees every prime factor of ∏S+1 is outside S.

Appendix Implementation notes