Euclid–Mullin sequence

The Euclid–Mullin sequence is an infinite sequence of distinct prime numbers, in which each element is the least prime factor of one plus the product of all earlier elements.

They are named after the ancient Greek mathematician Euclid, because their definition relies on an idea in Euclid's proof that there are infinitely many primes, and after Albert A. Mullin, who asked about the sequence in 1963.

Similarly, the seventh element, 5, is the result of (2 × 3 × 7 × 43 × 13 × 53) + 1 = 1244335, the prime factors of which are 5 and 248867.

These examples illustrate why the sequence can leap from very large to very small numbers.

This can be proved using the method of Euclid's proof that there are infinitely many primes.

Mullin (1963) asked whether every prime number appears in the Euclid–Mullin sequence and, if not, whether the problem of testing a given prime for membership in the sequence is computable.

[5] A related sequence of numbers determined by the largest prime factor of one plus the product of the previous numbers (rather than the smallest prime factor) is also known as the Euclid–Mullin sequence.