What is a prime number?
A prime number is a natural number greater than 1 that has no divisors other than 1 and itself. For example, 7 is prime because it's only divisible by 1 and 7, while 8 is not prime because it's divisible by 1, 2, 4, and 8. A natural number greater than 1 that isn't prime is called a "composite number."
How is primality checked?
To check whether a number n is prime, you test whether it's divisible by any number from 2 up to the square root of n. If none of them divide evenly, the number is prime. Checking only up to the square root is enough, because if n had a divisor larger than its square root, it would necessarily have a matching divisor smaller than the square root as well.
Why do prime numbers matter?
Primes are the fundamental building blocks of every natural number β a fact that makes them foundational to mathematics β and they're also central to modern cryptography. RSA encryption, for example, relies on the fact that it's extremely difficult to factor a large number back into the two large primes that were multiplied together to create it.
Frequently Asked Questions
Why isn't 1 considered a prime number?
A prime is defined as "a natural number greater than 1 whose only divisors are 1 and itself." Since 1 doesn't meet that condition, it's treated as a special case that is neither prime nor composite.
What's the maximum range for the prime list?
To keep the calculation smooth in your browser, the list generator is limited to a maximum of 10,000.