This is related to Euclid's proof of the infinitude of primes.
For any finite set $S = \{p_1, \ldots, p_r \}$ of primes, consider the number $n = p_1 p_2 \ldots p_r + 1$. This $n$ has a prime divisor $p$. But $p$ is not one of the $p_i$ (where $1 \leq i \leq r$): otherwise $p$ would be a divisor of $n$ and of the product $p_1 p_2 \ldots p_r$, and thus also of the difference $n – p_1 p_2 \ldots p_r = 1, which is impossible.
So, $S$ cannot be the collection of all prime numbers. (Q.E.D.)
Suppose I modify this proof into an algorithm for generating primes, as follows:
Start with some initial set $S_0 = S$; at each step $i$, constructing $n$ as described in the proof, set $S_{i + 1} = S_i \cup \{p: p \textrm{ is a prime divisor of } n\}$.
Clearly, this algorithm will produce a sequence of ever-larger sets of prime numbers, but the primes in these sets will not necessarily be consecutive. How can I find a starting set which leads to the largest set of consecutive prime numbers (each subsequently generated number should be next consecutive when added into the set)?
Ex. Initial set $S = \{ 2 \}$.
$n = 2 + 1 = 3$, $3$ has one prime factor only, i.e $3$, so the updated set is $S = \{2, 3 \}$.
$n = 2 \times 3 + 1 = 7$. $7$ has one prime factor only, i.e $7$, so $\{2, 3, 7 \}$.
But $5$ goes missing, hence starting with $2$ goes to maximum set size $2$.