Introduction
Euclid's argument says that from any finite list of primes, you can find a prime that isn't on it. Following the argument in words is one thing. Running it on actual numbers shows what it does and doesn't promise. This worked example applies the argument to two lists, checks every result by hand, and ends with a table of what each list produced.
The Problem
A prime is a whole number greater than 1 whose only positive divisors are 1 and itself. Euclid's argument goes like this. Multiply all the primes on a list together, then add 1. The new number leaves remainder 1 when divided by each listed prime, so none of them divides it. Either the new number is prime, or it has a prime factor. Either way, that prime is missing from the list (Euclid, Elements IX.20). The locator IX.20 means Book IX, Proposition 20.
Here are the two lists:
- List A: {2, 3, 5}
- List B: {2, 3, 5, 7, 11, 13}
For each list, the task is to form the product plus 1, decide whether it's prime, and find at least one prime that isn't on the list. Then you'll say what the two results together show.
Working It Through
Step 1: Multiply the first list and add 1
Multiply the primes in List A: 2 \times 3 \times 5 = 30. Add 1 to get 31.
Before testing 31, check the remainders. Dividing 31 by 2 gives 15 with 1 left over. Dividing by 3 gives 10 with 1 left over. Dividing by 5 gives 6 with 1 left over. Every listed prime leaves remainder 1, as the argument says it must. That happens because 30 is a multiple of each listed prime, so the only thing left after dividing is the 1 you added.
Step 2: Check 31 by trial division up to its square root
Trial division means dividing by each prime in turn to see whether any of them goes in evenly. You don't have to try every number below 31. If 31 were a product of two whole numbers, both bigger than 1, at least one of them would be no bigger than the square root of 31. The square root of a number is the value that, multiplied by itself, gives that number. Since 5 \times 5 = 25 and 6 \times 6 = 36, the square root of 31 lies between 5 and 6.
So you only need to test the primes 2, 3, and 5. You've already seen that each leaves remainder 1. None divides 31, so 31 is prime. It isn't on List A. The argument found a new prime directly.
Step 3: Multiply the second list and add 1
Multiply the primes in List B:
2 \times 3 \times 5 \times 7 \times 11 \times 13 = 30{,}030
You can build it up in stages: 30 \times 7 = 210, then 210 \times 11 = 2{,}310, then 2{,}310 \times 13 = 30{,}030. Add 1 to get 30,031.
Step 4: Trial division finds that 30,031 is composite
A composite number is a whole number greater than 1 with a divisor other than 1 and itself. To test 30,031, you need primes up to its square root. Since 173 \times 173 = 29{,}929 and 174 \times 174 = 30{,}276, the square root lies between 173 and 174. So you test primes up to 173.
The primes on List B can't divide 30,031, by the argument. So start with 17, the first prime not on the list. Working upward through 17, 19, 23, 29, 31, 37, 41, 43, 47, and 53, each leaves a remainder. Then try 59:
30{,}031 = 59 \times 509
Check it by multiplying: 59 \times 500 = 29{,}500 and 59 \times 9 = 531, and 29{,}500 + 531 = 30{,}031. So 30,031 is composite. The product plus 1 is not prime this time.
Is 509 prime? Its square root lies between 22 and 23, since 22 \times 22 = 484 and 23 \times 23 = 529. Test the primes 2, 3, 5, 7, 11, 13, 17, and 19. None divides 509, so it's prime. And 59 is prime, since no prime up to 7 divides it (7 \times 7 = 49 and 8 \times 8 = 64).
Step 5: Check that the new primes are missing from the list, and that each listed prime leaves remainder 1
Neither 59 nor 509 appears on List B, which stops at 13. So the argument still delivered, twice over.
Now confirm the remainders. Because 30,030 is a multiple of every prime on List B, dividing 30,031 by any of them leaves 1. Dividing 30,030 by 2, 3, 5, 7, 11, and 13 gives 15,015, 10,010, 6,006, 4,290, 2,730, and 2,310, all whole numbers. So, for instance, 30{,}031 = 15{,}015 \times 2 + 1 and 30{,}031 = 2{,}310 \times 13 + 1. The other four divisions work the same way. That's exactly why none of 2, 3, 5, 7, 11, or 13 could be a factor of 30,031.
Step 6: State what the example shows
The two lists behave differently. List A gave a number that is itself prime. List B gave a number that isn't prime, but whose prime factors are both new. That is all Euclid's argument claims. The product plus 1 need not be prime. It always supplies at least one prime missing from the list.
Key Considerations
The common mistake is believing that "the product plus one is always prime." It's an easy slip, because small lists such as {2}, {2, 3}, {2, 3, 5}, and {2, 3, 5, 7} all give primes: 3, 7, 31, and 211. List B is the counterexample. Its product plus 1, 30,031, equals 59 \times 509. Euclid never claimed the number is prime, and the argument doesn't need it to be. It needs only that the number has some prime factor, and that no listed prime is that factor.
A second point concerns trial division. You only need to test primes up to the square root, and only primes, not every number. If a composite number divides your number, so does each of its prime factors, and you'd have found one of those already. Without the square-root limit, testing 30,031 would mean trying primes all the way up. With it, you stop at 173.
The lists here happen to be the first few primes in order. Nothing in the argument requires that. Any finite list of primes works, in any order, with gaps or without.
Finally, the argument doesn't tell you which new prime you'll get, and it needn't be the next prime after the list. List A produced 31, skipping every prime from 7 to 29. List B produced 59 and 509, skipping 17 through 53. The argument guarantees that some prime is missing, not which one.
Summary
Running the argument on two lists shows both outcomes it allows: a new number that is prime, and a new number that is composite with new prime factors.
| List | Product plus 1 | Prime or composite | New prime(s) found |
|---|
| {2, 3, 5} | 31 | Prime | 31 |
| {2, 3, 5, 7, 11, 13} | 30,031 | Composite (59 \times 509) | 59 and 509 |
- Each row's product plus 1 leaves remainder 1 when divided by every prime on its list.
- Trial division up to the square root confirmed each verdict.
- In both rows, at least one prime missing from the list appears.
References
- Euclid. Elements. Edited and translated by David E. Joyce, after T. L. Heath's edition. Worcester, MA: Clark University, 1996–2013.