Prime or not
A prime number is a whole number greater than one whose only factors are one and itself. This checks any number, and shows the factors when there are some.
A whole number of two or more.
The first thirty primes
- 1 2
- 2 3
- 3 5
- 4 7
- 5 11
- 6 13
- 7 17
- 8 19
- 9 23
- 10 29
- 11 31
- 12 37
- 13 41
- 14 43
- 15 47
- 16 53
- 17 59
- 18 61
- 19 67
- 20 71
- 21 73
- 22 79
- 23 83
- 24 89
- 25 97
- 26 101
- 27 103
- 28 107
- 29 109
- 30 113
How many there are
Primes thin out as numbers grow, but they never run out: there is no largest prime, which Euclid proved in the Elements more than two thousand years ago. Counted with the same test this checker uses, this is how many there are below each power of ten.
| Below | Primes | Share of the numbers, rounded |
|---|---|---|
| 10 | 4 | 40% |
| 100 | 25 | 25% |
| 1,000 | 168 | 16.8% |
| 10,000 | 1,229 | 12.3% |
| 100,000 | 9,592 | 9.6% |
| 1,000,000 | 78,498 | 7.8% |
Limits
Certainty. The primality test is proven correct up to about 3.3 × 10²⁴. Past that it becomes a very good guess, so above that limit the tool says it cannot decide.
Factors. Finding the factors of a large number is far harder than deciding whether it has any, so factorising stops at fourteen digits. Past that the tool says the number is composite without listing what it divides by.
Checking by hand
To check a number by hand, divide it by each prime up to its square root, and stop there: a number that is not prime always has a factor other than 1 that is no bigger than its square root. The square root of 221 is about 14.9, so the primes to try are 2, 3, 5, 7, 11 and 13. The first five leave a remainder and 13 goes in exactly: 221 = 13 × 17, so 221 is not prime.
Questions
- Is 1 a prime number?
- No. A prime has exactly two factors, one and itself, and 1 has only one.
- Is 2 a prime number?
- Yes, and it is the only even prime: every other even number divides by 2.
- What are the prime factors of 360?
- 2³ × 3² × 5, which is 2 × 2 × 2 × 3 × 3 × 5.