Skip to content

The Euclid–Mullin Sequence: Building New Primes

  • Updated: September 25, 2026
📌

Complete guide: Prime Number Patterns

The Euclid–Mullin sequence starts with 2 and repeatedly turns the primes already found into a new prime. Its first terms are 2, 3, 7, 43, 13, 53, 5, 6,221,671, 38,709,183,810,571, …. The rule is simple, but the sequence is not an increasing list of primes and the number formed at each step is not always prime.

Euclid–Mullin Rule

Let Pn = a1a2…an, the product of all terms found so far. Then

an+1 = spf(Pn + 1)

Here, spf means the smallest prime factor. The sequence begins with a1 = 2.

How the First Terms Are Built

The early steps show exactly what the rule does. For the first few terms, Pn + 1 happens to be prime. The first change in behavior comes at 1807.

Generation of the first nine Euclid–Mullin terms.
TermProduct + 1FactorizationSelected Prime
a1222
a2333
a3777
a4434343
a51,80713 × 13913
a623,47953 × 44353
a71,244,3355 × 248,8675
a86,221,671prime6,221,671
a938,709,183,810,571prime38,709,183,810,571

Why 1807 Produces 13

The first four terms can create a misleading pattern:

2 × 3 × 7 × 43 + 1 = 1,807

1,807 = 13 × 139

The Euclid–Mullin sequence does not keep 1807. It keeps the smallest prime factor, so a5 = 13.

Product + 1 Is Not Guaranteed to Be Prime

The number Pn + 1 is guaranteed to have no prime factor that already appears among a1, …, an. That does not make Pn + 1 prime. It may be composite, as 1807 shows.

How 5 Appears After 53

The sequence is not arranged by numerical size. After 13, the next selected prime is 53 because

2 × 3 × 7 × 43 × 13 + 1 = 23,479 = 53 × 443.

Including 53 gives a product of 1,244,334, so the next candidate is

1,244,334 + 1 = 1,244,335 = 5 × 248,867.

The smallest prime factor is 5, which becomes a7. A small prime can therefore appear after much larger primes if it has not appeared before and becomes the smallest divisor of the next candidate.

Test a Euclid–Mullin Candidate

Try 1807, 1244335, or 6221671 to compare composite candidates with a generated prime.

Enter a number
Works for integers up to 15 digits

Why Earlier Primes Cannot Appear Again

Suppose Pn is the product of the primes already in the sequence. Every earlier term ai divides Pn, so

Pn ≡ 0 (mod ai)

and therefore

Pn + 1 ≡ 1 (mod ai).

So no earlier ai can divide Pn + 1. Equivalently, Pn and Pn + 1 are coprime. Every prime factor of the new candidate is different from every prime already selected.

This also explains why the process never runs out of new primes. Every integer greater than 1 has at least one prime factor, and every prime factor of Pn + 1 is new to the sequence.

The Connection With Euclid’s Proof

Euclid’s classical argument for infinitely many primes uses the same product-plus-one idea. Given a finite collection of primes, their product plus 1 is not divisible by any prime in that collection. The number itself may be prime or composite, but at least one of its prime factors must be new.

The Euclid–Mullin sequence turns that observation into a deterministic recurrence: whenever several new prime factors are available, it selects the smallest one.

The Sequence Can Jump Up or Down

There is no monotonic growth rule. The position of a prime depends on divisibility of the successive product-plus-one candidates, not on the prime’s numerical size. This is why 43 arrives as the fourth term, while 5 does not appear until the seventh term and 31 waits until the fiftieth.

Positions of selected small primes in the known Euclid–Mullin sequence.
PrimePosition
21
32
57
73
1112
135
1713
1936
2325
2933
3150
3718
41Not among the first 51 known terms
434

Among primes smaller than 41, every one appears somewhere in the first 51 known terms. That makes 41 the smallest prime not yet seen in the known part of the sequence.

Euclid–Mullin, Sylvester, and the Largest-Factor Rule

The sequences agree at first because 2, 3, 7, and 43 each arise from a prime product-plus-one value. They separate at 1807.

Three related rules at the first point where the candidate is composite.
RuleWhat Happens to 1,807 = 13 × 139Next Value
Euclid–Mullin sequenceSelect the smallest prime factor13
Second Mullin sequenceSelect the largest prime factor139
Sylvester’s sequenceKeep the entire product-plus-one value1,807

The choice at one step changes every product that follows. The smallest-factor Euclid–Mullin sequence and the largest-factor sequence are therefore different objects, even though both begin 2, 3, 7, 43.

A Result That Applies Only to the Second Sequence

The largest-prime-factor version is known to omit infinitely many primes. That result must not be transferred to the original smallest-prime-factor Euclid–Mullin sequence, for which the question of whether every prime eventually appears remains open.

Why Computing Later Terms Becomes Difficult

The recurrence is deterministic, but determining the next value requires more than showing that a candidate is composite. The sequence needs the smallest prime factor of Pn + 1.

This creates a sharp distinction between primality testing and prime factorization. A primality test can establish that a large integer is composite without revealing its smallest prime divisor. Euclid–Mullin computation cannot move to the next term until that divisor is known.

The product also retains every large prime already selected. When a very large term enters the sequence, every later Pn contains it, so the candidate numbers can grow quickly.

Selected computational milestones in extending the sequence.
Target TermCandidate SizeWhat Was Needed
a44180 digitsA full factorization in 2010 revealed a 68-digit smaller prime factor, which became a44.
a48256 digitsA 75-digit factor found in 2012 became a48.
a52335 digitsThe smallest prime factor is still required.

The 51 Known Terms

The large jumps are easier to see when the terms are kept in sequence order. The entries at positions 44 and 48 are especially large: they have 68 and 75 digits respectively.

Show all 51 known Euclid–Mullin terms
  1. 2
  2. 3
  3. 7
  4. 43
  5. 13
  6. 53
  7. 5
  8. 6,221,671
  9. 38,709,183,810,571
  10. 139
  11. 2,801
  12. 11
  13. 17
  14. 5,471
  15. 52,662,739
  16. 23,003
  17. 30,693,651,606,209
  18. 37
  19. 1,741
  20. 1,313,797,957
  21. 887
  22. 71
  23. 7,127
  24. 109
  25. 23
  26. 97
  27. 159,227
  28. 643,679,794,963,466,223,081,509,857
  29. 103
  30. 1,079,990,819
  31. 9,539
  32. 3,143,065,813
  33. 29
  34. 3,847
  35. 89
  36. 19
  37. 577
  38. 223
  39. 139,703
  40. 457
  41. 9,649
  42. 61
  43. 4,357
  44. 87,991,098,722,552,272,708,281,251,793,312,351,581,099,392,851,768,893,748,012,603,709,343
  45. 107
  46. 127
  47. 3,313
  48. 227,432,689,108,589,532,754,984,915,075,774,848,386,671,439,568,260,420,754,414,940,780,761,245,893
  49. 59
  50. 31
  51. 211

Does Every Prime Eventually Appear?

Albert A. Mullin introduced the recursive prime problem in 1963. For the smallest-factor sequence, the central question remains unresolved: does every prime number eventually occur?

The rule proves that each term is a new prime, but that is not the same as proving that every prime will eventually be selected. A prime can remain absent for a long time because it must become the smallest prime factor of one particular product-plus-one candidate.

Proved

Every term is prime, no term repeats, and the process produces infinitely many distinct primes.

Observed in the Known Terms

The sequence is known through a51 = 211, and 41 has not yet appeared.

Still Unknown

It is not known whether 41 eventually appears or whether the sequence contains every prime.

The Unresolved 52nd Term

Checked on August 25, 2026: the known sequence reaches a51 = 211. Determining a52 requires the smallest prime factor of the next product-plus-one value, a 335-digit composite integer. That smallest factor has not yet been determined.

Next-Term Condition

a52 = spf(P51 + 1)

P51 + 1 has 335 decimal digits, so the recurrence is fully defined even though the next prime is not yet known.