Math

Prime Number Checker (up to 10,000,000)

Instantly check if any integer N up to 10,000,000 is prime. Shows trial division steps, previous and next prime, and prime factorization.

First 100 Prime Numbers

#1–10 #2–11 #3–12 #4–13 #5–14 #6–15 #7–16 #8–17 #9–18 #10–19
2 3 5 7 11 13 17 19 23 29
31 37 41 43 47 53 59 61 67 71
73 79 83 89 97 101 103 107 109 113
127 131 137 139 149 151 157 163 167 173
179 181 191 193 197 199 211 223 227 229
233 239 241 251 257 263 269 271 277 281
283 293 307 311 313 317 331 337 347 349
353 359 367 373 379 383 389 397 401 409
419 421 431 433 439 443 449 457 461 463
467 479 487 491 499 503 509 521 523 541

Tips

  • A prime number is an integer greater than 1 with no divisors other than 1 and itself. The sequence begins 2, 3, 5, 7, 11, 13, …
  • The simplest primality test is trial division: try dividing N by every integer from 2 up to √N. If none divides evenly, N is prime.
  • 1 is not prime. The definition of prime requires "greater than 1." The number 2 is the only even prime.
  • There are infinitely many primes (proved by Euclid around 300 BCE). Their density decreases with size — near n, about 1 in every ln(n) integers is prime (Prime Number Theorem).

FAQ

2 has no divisors other than 1 and itself, so it qualifies as prime by definition. It is also the only even prime — every other even number is divisible by 2.

The definition of prime excludes 1 ("an integer greater than 1"). Excluding 1 is necessary for the Fundamental Theorem of Arithmetic to hold: if 1 were prime, factorizations would not be unique (e.g. 6 = 2 × 3 = 1 × 2 × 3 = 1¹⁰⁰ × 2 × 3).

Trial division runs in O(√N) time. For N = 10,000,000, √N ≈ 3162, so at most ~3162 divisions are needed. This is fast enough for interactive use, though more efficient algorithms (Miller-Rabin, AKS) exist for very large numbers.
ツールくん

Side Note — Why prime numbers matter

Primes are the "atoms of arithmetic." The Fundamental Theorem of Arithmetic states every integer greater than 1 has a unique prime factorization — meaning primes are the irreducible building blocks of all whole numbers.

Modern RSA encryption — securing HTTPS traffic and digital signatures — relies on prime numbers. Multiplying two large primes together is trivial; factoring their product back into primes is computationally infeasible, even for modern supercomputers. Primes underpin the security of the internet.