Enter a number to test it. 91 is not prime (91 = 7 × 13), while 97 is. The second box finds the nth prime.
How to check if a number is prime
- Numbers below 2 are not prime; 2 and 3 are.
- If it is even (other than 2) or its digit sum is a multiple of 3, it is not prime.
- Otherwise try dividing by 5, 7, 11, 13, … up to its square root. If nothing divides evenly, it is prime.
Example: to test 97, √97 ≈ 9.85, so try 2, 3, 5, 7. None divides 97, so 97 is prime.
Numbers that look prime but are not
Nth prime reference
| n | nth prime |
|---|
| 1 | 2 |
| 10 | 29 |
| 100 | 541 |
| 1,000 | 7,919 |
| 10,000 | 104,729 |
| 100,000 | NaN |
| 1,000,000 | NaN |