# Prime numbers: why they thin out, how to test one, and why your bank depends on them

> There are 25 primes below 100 but only 168 below 1,000 and 78,498 below a million. They never run out, yet they get steadily rarer. This guide shows how to test a number by hand, why you only need to check up to its square root, and how a simple fact about primes protects online payments.

Published 2026-10-08 by Toolcloak. 7 minute read. Original: https://toolcloak.pages.dev/articles/prime-numbers-why-they-thin-out-and-why-your-bank-depends-on-them
Related free tool: [Prime Number Checker](https://toolcloak.pages.dev/tools/prime-number-checker)

Is 91 a prime number? Most people pause, think it looks prime, and say yes. It is not: 91 = 7 × 13. Primes are the atoms of arithmetic, and the surprising thing is how often our eyes get them wrong. This guide gives you a reliable way to test any number, a picture of how primes are spread, and a look at the real-world job they do every time you pay online.

> **In short**
> - A **prime** is a whole number greater than 1 whose only divisors are 1 and itself. **2** is the only even prime, and **1 is not prime**.
> - To test **n**, you only need to try dividing by primes up to **√n**. For 1,000,003 that is primes up to 1,000, just 168 of them.
> - Primes **never run out** (Euclid, about 2,300 years ago) but get **rarer**: 25% of numbers below 100 are prime, 7.85% below a million.
> - Online security relies on the fact that **multiplying two big primes is easy and undoing it is not**.

## What makes a number prime

A number is **prime** if it has exactly two divisors: 1 and itself. 7 is prime (only 1 × 7). 9 is not (3 × 3 is another way to build it). Numbers with more divisors are called **composite**. The number 1 has only one divisor, so it is neither prime nor composite, and 2 is the only even prime, since every larger even number is divisible by 2.

Why do mathematicians care? Because of a basic fact: every whole number above 1 can be written as a product of primes in exactly one way (ignoring order). 60 = 2 × 2 × 3 × 5, and no other combination of primes gives 60. Primes are the building blocks, and the multiplication table is built from them.

**The primes from 1 to 100 (dark cells are prime)**

| Numbers | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| 0 + | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| 10 + | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 20 + | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 |
| 30 + | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 |
| 40 + | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 |
| 50 + | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 |
| 60 + | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 |
| 70 + | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 |
| 80 + | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 |
| 90 + | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 |

| Looks prime… | But it is | Quick tell |
| --- | --- | --- |
| 51 | 3 × 17 | Digits add to 6, so 3 divides it |
| 57 | 3 × 19 | Digits add to 12 |
| 87 | 3 × 29 | Digits add to 15 |
| 91 | 7 × 13 | Needs the 7 times table |
| 119 | 7 × 17 | Needs the 7 times table |

*The digit-sum rule for 3 catches many fakes. 7 and 13 are the usual troublemakers.*

Try it: [Prime Number Checker](https://toolcloak.pages.dev/tools/prime-number-checker). Type any number to find out if it is prime, and see its smallest divisor if it is not.

## How to test a number: stop at the square root

The obvious way to test n is to try dividing by every number up to n. That is slow. Luckily there is a shortcut. If n = a × b, then one of the two factors must be at most √n. (If both were bigger than √n, their product would be bigger than n.) So if no divisor appears up to √n, none will appear after it, and the number is prime.

**Testing whether 1,000,003 is prime**

1. **Find the square root.** √1,000,003 is about 1,000.0015. Only divisors up to 1,000 matter.
2. **Try only primes.** There are 168 primes below 1,000, so at most 168 divisions, not a million.
3. **Stop at the first hit.** If any prime divides evenly, the number is composite. None does here.
4. **Conclude.** 1,000,003 is prime. A shortcut turned a million checks into 168.

*The shortcut gets better with size: the work grows with the square root of the number, not the number itself.*

**Divisions needed by plain trial division (up to √n)**

|  | Largest divisor to try |
| --- | --- |
| n ≈ 1 million | 1,000 |
| n ≈ 1 billion | 31,623 |
| n ≈ 1 trillion | 1,000,000 |
| n ≈ 10¹⁵ | 31.6 million |

*Multiplying n by 1,000 multiplies the work by about 31.6. Even so, this method is hopeless for the 600-digit numbers used in cryptography, which use cleverer tests.*

> **Quick divisibility rules:** By **2**: ends in 0, 2, 4, 6, 8. By **3**: digits add to a multiple of 3. By **5**: ends in 0 or 5. By **11**: alternate digits and subtract; if the answer is 0 or a multiple of 11, it divides. These four cover most composites you will meet.

## Finding all the primes: the sieve

Suppose you want every prime up to 100 at once. An old method called the **Sieve of Eratosthenes**, over two thousand years old, does it without any division at all. Write down the numbers, then repeatedly cross out the multiples of each surviving number. What is left is prime.

**The Sieve of Eratosthenes, up to 100**

1. **List 2 to 100.** Start with every number except 1.
2. **Keep 2, cross out its multiples.** 4, 6, 8, 10 and so on disappear.
3. **Keep 3, cross out its multiples.** 9, 15, 21 and all other odd multiples go.
4. **Keep 5 and 7, repeat.** After 7 you can stop, because 11 × 11 is already bigger than 100.
5. **Read what survived.** The 25 numbers left are exactly the primes below 100.

A computer can run the same sieve on ten million numbers in a fraction of a second. That is how the prime counts in this article were checked.

## Primes never end, but they thin out

Euclid’s proof that there are infinitely many primes is only a few lines: assume there is a largest prime, multiply all primes together and add 1; the result is not divisible by any of them, so there must be a new prime. Beautiful, short and still airtight.

Yet primes become sparser as you climb. In the first hundred numbers, a quarter are prime. In each later hundred, there are fewer. Here is the count for each century up to 1,000.

**Primes in each block of 100 numbers (1 to 1,000)**

|  | Value |
| --- | --- |
| 1–100 | 25 |
| 101–200 | 21 |
| 201–300 | 16 |
| 301–400 | 16 |
| 401–500 | 17 |
| 501–600 | 14 |
| 601–700 | 16 |
| 701–800 | 14 |
| 801–900 | 15 |
| 901–1000 | 14 |

*The counts total 168. The trend is downward, but not smoothly: 16 and then 16 and then 17. Primes are irregular in the small and predictable in the large.*

**How many primes up to x, and what share of numbers that is**

| When | What |
| --- | --- |
| 10 | 4 primes. 2, 3, 5, 7. That is 40% of the numbers. |
| 100 | 25 primes. 25% of the numbers. |
| 1,000 | 168 primes. 16.8%. Roughly one in six. |
| 10,000 | 1,229 primes. 12.3%. Roughly one in eight. |
| 1 million | 78,498 primes. 7.85%. Roughly one in thirteen. |
| 10 million | 664,579 primes. 6.65%. Roughly one in fifteen. |

**Share of numbers that are prime: actual against the 1 ÷ ln x estimate (percent)**

| Numbers up to x | Actual share of primes | Estimate 1 ÷ ln x |
| --- | --- | --- |
| 10 | 40 | 43.43 |
| 100 | 25 | 21.71 |
| 1k | 16.8 | 14.48 |
| 10k | 12.29 | 10.86 |
| 100k | 9.59 | 8.69 |
| 1M | 7.85 | 7.24 |
| 10M | 6.65 | 6.2 |

*The prime number theorem says the share near x is about 1 divided by the natural logarithm of x. The estimate is close and gets relatively better as x grows. Primes thin out, but very slowly.*

## Odd patterns: twin primes and open questions

Primes that differ by 2 are called **twin primes**: (3, 5), (5, 7), (11, 13), (17, 19), (29, 31), (41, 43). Whether there are infinitely many of them is still unproven, as is the **Goldbach conjecture**, which says every even number above 2 is the sum of two primes (4 = 2 + 2, 10 = 3 + 7, 100 = 3 + 97). Computers have checked it for enormous ranges without a counterexample, yet nobody has a proof.

**A few famous prime facts**

| Box | What it means |
| --- | --- |
| Infinitely many primes | Proved by Euclid. There is no biggest prime. |
| Unique factorisation | Every whole number above 1 is a product of primes in exactly one way. |
| Twin primes | Pairs like 11 and 13. Infinitely many? Still an open question. |
| Goldbach | Every even number above 2 is a sum of two primes. Checked widely, unproven. |

*Primes are an area where a child can ask a question that stumps experts.*

## The job primes do for your bank

Here is the practical payoff. Multiplying two primes is easy: 101 × 103 = 10,403 takes a moment. Going the other way, finding the two primes that produce 10,403, takes real work. With small numbers it is just a puzzle. With numbers hundreds of digits long, the best known methods on ordinary computers would need an impractical amount of time.

That one-way difficulty is the heart of **RSA**, one of the systems that protects secure websites. A common key has 2,048 bits, a number of about 617 digits, built from two primes of roughly 309 digits each. Your browser and the server can use the public product freely. Only someone who knows the two primes can reverse the process.

**Easy one way, very hard the other**

| Multiply two big primes | Factor the product back |
| --- | --- |
| Instant | Impractical |
| Two 309-digit primes | No known fast method on classical computers |
| A fraction of a second | Brute force is far beyond practical computing power |
| Produces a 617-digit number | Quantum computers could change this, which is why new methods are being developed |

*Security does not come from hiding the method, only from this gap in effort. See [what a hash is](https://toolcloak.pages.dev/articles/what-a-hash-is-and-why-changing-one-letter-changes-everything) and [password entropy](https://toolcloak.pages.dev/articles/password-entropy-bits-guesses-and-why-length-beats-symbols) for other forms of the same idea.*

**A typical RSA key in numbers**

|  | Value | Note |
| --- | --- | --- |
| Size of the public number | 2,048 bits | About 617 decimal digits |
| Each secret prime | ~309 digits | Two of them, multiplied together |
| Odd candidates that are prime | 1 in ~355 | So about 355 random odd tries finds one |

*Finding the primes is quick. Recovering them from the product, without being told, is what nobody can do in practice.*

How do you find a 309-digit prime in the first place? By trial and error with a fast probabilistic test. Roughly 1 in 710 numbers of that size is prime (1 ÷ ln N), or 1 in about 355 if you skip even numbers. A computer simply picks random odd numbers and tests them until one passes, which takes a fraction of a second.

## Practice and take-aways

1. Is 221 prime? √221 is about 14.9. Try 2, 3, 5, 7, 11, 13. 13 × 17 = 221, so it is **not** prime.
2. Is 97 prime? √97 is about 9.8. Try 2, 3, 5, 7. None divides, so it **is** prime.
3. Write 84 as a product of primes: 84 = 2 × 2 × 3 × 7.
4. Which is the only even prime? **2**, because every other even number is divisible by 2.

Primes combine the simplest definition in mathematics with some of the hardest unsolved questions. They thin out gently, hide behind clever fakes like 91, and quietly keep your payments private. Paste any number in the checker above and see for yourself. If you like number systems, the [binary, hex and decimal](https://toolcloak.pages.dev/articles/binary-hex-and-decimal-counting-in-bases-2-10-and-16) guide is a natural next step.

## Frequently asked questions

### Is 1 a prime number?

No. A prime has exactly two divisors, 1 and itself, and 1 has only one divisor. This convention keeps the unique-factorisation rule true.

### Is 2 prime?

Yes, and it is the only even prime. Every other even number is divisible by 2, so it has at least three divisors.

### How do I check if a number is prime?

Divide it by every prime up to its square root. If none divides evenly, the number is prime.

### How many primes are there below 100?

25: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89 and 97.

### Why are prime numbers used in encryption?

Multiplying two large primes is quick, but recovering them from the product is extremely hard with known methods. Systems such as RSA are built on that gap.

### Are there infinitely many primes?

Yes. Euclid proved it over 2,000 years ago: no list of primes can be complete, because multiplying them and adding 1 produces a number with a prime factor outside the list.

