Prime Number Calculator
Check primality, factorize, and list prime numbers
Primality
—
Related Calculators
Frequently Asked Questions
What is a prime number?
A prime number is a natural number greater than 1 that has exactly two divisors: 1 and itself. Examples: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29... The number 1 is NOT prime (only 1 divisor). 2 is the only even prime. There are infinitely many primes (Euclid proved this around 300 BC).
How do I check if a number is prime?
Trial division: test if any integer from 2 to sqrt(n) divides n. If none do, n is prime. For n=97: sqrt(97) ≈ 9.8, check divisors 2,3,5,7. None divide 97, so 97 is prime. This is O(sqrt(n)). For very large numbers, use probabilistic tests like Miller-Rabin.
What is prime factorization?
Every composite (non-prime) number can be uniquely expressed as a product of primes. 360 = 2^3 × 3^2 × 5. This is the Fundamental Theorem of Arithmetic. Applications: GCD, LCM, RSA encryption (based on difficulty of factoring large semiprimes), divisibility rules.
What are twin primes?
Twin primes are prime pairs that differ by 2: (3,5), (5,7), (11,13), (17,19), (29,31), (41,43)... The Twin Prime Conjecture says there are infinitely many twin prime pairs, but this is unproven. The largest known twin prime pair has over 300,000 digits.
Why is 1 not a prime number?
If 1 were prime, the Fundamental Theorem of Arithmetic (unique prime factorization) would fail: 6 = 2×3 = 1×2×3 = 1^2×2×3, making factorization non-unique. By defining primes as having exactly 2 divisors (excluding 1 and itself), we preserve unique factorization. 1 is called a unit.
Prime Factorization Examples
| Number | Prime Factorization |
|---|---|
| 12 | 2² × 3 |
| 60 | 2² × 3 × 5 |
| 100 | 2² × 5² |
| 360 | 2³ × 3² × 5 |
| 1000 | 2³ × 5³ |
| 1024 | 2¹⁰ |