# Primes Number Sequence

Find the pattern in the sequence:

10 11 21 247 29 391 ? ? ?

The next three numbers are:

1271, 47, 1591

The pattern:

Let $$a_i$$ denote the $$i$$-th number in the sequence, $$p_i$$ denote the $$i$$-th prime number.

We have
$$a_1 = 10 = 2 \times 5 = p_1 \times p_3$$
$$a_2 = 11 = p_5$$
$$a_3 = 21 = 3 \times 7 = p_2 \times p_4$$
$$a_4 = 247 = 13 \times 19 = p_6 \times p_8$$
$$a_5 = 29 = p_{10}$$
$$a_6 = 391 = 17 \times 23 = p_7 \times p_9$$

Therefore for $$i \ge 0$$:
$$a_{3i+1} = p_{5i+1} \times p_{5i+3}$$
$$a_{3i+2} = p_{5i+5}$$
$$a_{3i+3} = p_{5i+2} \times p_{5i+4}$$

Plug $$2$$ into $$i$$ we can get:
$$a_7 = p_{11} \times p_{13} = 31 \times 41 = 1271$$
$$a_8 = p_{15} = 47$$
$$a_9 = p_{12} \times p_{14} = 37 \times 43 = 1591$$