# An arithmetic progression with primes

Here is a math puzzle I thought of a while ago:

Find the longest arithmetic progression that consists only of primes, such that the difference between two consecutive terms is the product of two primes.

Good luck!

The longest such arithmetic progression has length

$5$

Example

$5, 11, 17, 23, 29$

Proof

Let the arithmetic progression be denoted by $a_1, a_2, \ldots$ and consecutive difference be $d = pq$ so that $a_i = (i-1)d + a_1$ and $p$ and $q$ are primes.

If $p$ and $q$ are both odd and $a_1$ is odd then $a_2$ is even and greater than $2$, so $a_2$ is not prime.

If $a_1 = 2$ and $p$ and $q$ are both odd, then $a_3$ is even and the longest possible prime arithmetic progression has length $2$.

Now let us consider $p=2$ and consider everything modulo $3$. If $q \neq 3$, then $pq \not\equiv 0 (\bmod 3)$ and one of $a_2, a_3, a_4$ is divisible by $3$ so the longest prime arithmetic progression in this instance has length $3$ (example $3, 7, 11$)

Our only other case is $pq = 6$.
Considering everything modulo $5$, we find that one of $a_2, a_3, a_4, a_5, a_6$ must be divisible by $5$ so the longest prime arithmetic progression has length $5$ (this is the case for $a_1 = 5$ so that $a_6$ is the next number divisible by $5$).

• $29 + 2*7 = 43$ all primes? if $p$ & $q$ doesn't have to be the same – Gintas K Jul 22 '16 at 11:03
• @GintasK we are looking for an "arithmetic progression" so the consecutive differences always have to be the same. – hexomino Jul 22 '16 at 13:32
• Oh, right! Sorry, I'm not very observant today :) Friday... – Gintas K Jul 22 '16 at 13:47

For arithmetic progression being the numbers prime, we can get only three-term in a series at longest. Surely there will include number 3, cause for any three-term arithmetic series, one of the terms must be divided by 3. And as 3 is prime we can include it. like:

$3, 5, 7$;
$3, 7, 11$;
$3, 17, 31$;
$3, 23, 43$
and so on.

• In the arithmetic sequence $1,4,7,10,\ldots$ none of the terms is divisible by 3. – f'' Jul 23 '16 at 5:39
• Welcome to Puzzling.SE. Please read the tour page and use >! to add spoilers to your answer. :) – ABcDexter Jul 23 '16 at 6:00