Open in CoCalc with one click!
%\textwidth=1.1\textwidth
%\hoffset=-.3in
%\textheight=1.1\textheight
%\voffset=-.5in
% The pari code I used:
% prog(p, a,  i=0) = while(isprime(p+a*i),i++);return(i);
% f(a, l, j=200000, i=0) = for(i=1,j,\
%    if(prog(prime(i),a)>=l,print1(prime(i),"  ");i+=l-2));
\include{macros}
\title{Arithmetic Progressions of Primes}
\author{W. Stein\footnote{UC Berkeley, Department of Mathematics, {\tt was@math.berkeley.edu}}}
Let $2n$ be an even integer.
What is the longest arithmetic progression
$p,\,p+2n,\,\ldots,\,p+2na$
with $p$ prime?  In this paper we guess some answers.
{\bf Warning:} The following is just for fun!  There could be
a well-known conjecture which supercedes all of this.
It is easy to show (see Proposition~\ref{prop}) that if
$$p,\, p+2,\, p+4$$
are all prime, then $p=3$.
Similarly, if
$$p,\, p+6,\, p+12,\, p+18,\, p+24$$
are all prime, then $p=5$ and the progression is thus
$5, \,11,\,  17, \,   23,\,      29.$
There are probably infinitely many examples where
$$p,\, p+6,\, p+12, \, p+18,$$
are all prime, but one would not dare think of proving this
here as it is probably more difficult than the twin primes conjecture.
For each even integer $2n$, let $M(2n)$ to be
the maximal length of an arithmetic progression
of primes with gap $2n$.  Thus $M(2)=3$, $M(6)=5$.
Let $M_{\infty}(2n)$ be the maximum length of arithmetic
progressions of gap $2n$ which occur
infinitely often.  Thus one conjectures that
$M_{\infty}(2)=2$, $M_{\infty}(6)=4$.
Is there an example in which
$M_{\infty}(2n)< M(2n)-1?$
Is there an upper bound on the possible
values $M(2n)$?
\section{Table}
The $M_?$ column was computed by searching the first
100000 or so primes for an arithmetic progression of
primes, having gap $2n$.
The $M_{\infty?}$ column was computed by doing the same search,
but requiring that at least {\em two} distinct progressions were found
(usually there were many more). By Proposition~\ref{prop},
the computed values of $M_?$ are the actual value of
$M$, except possibly for the last four rows in the table.
\begin{tabular}{|c|c|c|c|l|}\hline
$2n$& $2n$ & $M_?$ & $M_{\infty?}$& Examples\\\hline\hline
$2$& $2$  &    3&   2 & 3\\
$4$& $2^2$  &    3&   2 & 3\\
$6$& $2\cdot 3$  &    5&   4 & 5\\
10& $2\cdot 5$  &    3&   2 & 3\\\hline
12& $2^2\cdot 3$ &    5&   4 & 5\\
14& $2\cdot 7$  &    3&   2 & 3\\
16& $2^4$  &    2&   2 & 3\\
18& $2\cdot 3^2$  &    4&   4 & 5\\
20& $2^2\cdot 5$  &    3&   2 & 3\\\hline
22& $2\cdot 11$  &    2&   2 & 7\\
24& $2^3\cdot 3$  &    4&   4 & 59\\
28& $2^2\cdot 7$  &    2&   2  & 3\\
30 &$2\cdot 3\cdot 5$ &    6&  6  & 7, 107 \\\hline
32 &$2^5$ &    2&  2  & 5\\
34 &$2\cdot 17$&    3&  2  & 3\\
36 &$2^2\cdot 3^2$&    4&  4  & 31\\
40 &$2^3\cdot 5$ &   3&  2  & 3\\\hline
42 &$2\cdot 3\cdot 7$&    5&  4  & 5\\
44 &$2^2\cdot 11$&    2&  2  & 3\\
46 & $2\cdot 23$  &    2&  2  & 7\\
48&$2^4\cdot 3$&    5&  4  & 5\\
50&$2\cdot 5^2$&    3&  2  & 3\\\hline
210 & $2\cdot 3\cdot 5\cdot 7$  &   10&  9  & 199\\
2310 & $2\cdot 3\cdot 5\cdot 7\cdot 11$&  9  & 9 & 3823\\
30030 & $2\cdot 3\cdot 5\cdot 7\cdot 11\cdot 13$&  12  & 12 & 23143,\,1498141\\
510510 & $2\cdot 3\cdot 5\cdot 7\cdot 11\cdot 13\cdot 17$&  13  & ? & 766439\\
\section{Conclusions}
\begin{proposition}\label{prop}
Let $q$ be a prime.
If $q\nmid 2n$ then
$M(2n)\leq q$ and  $M_{\infty}(2n)\leq q-1$.
Furthermore, $M(2n)=q$ iff $q$ is involved in arithmetic
progression of length $q$ with gap $2n$.
\end{proposition}
\begin{proof}
Reduce the arithmetic progression
$$p,\,p+2n,\,\ldots,\,p+2na$$
modulo $q$.  Since $2n$ is a unit
modulo $q$, if the length of the arithmetic progression
is $\geq q$ then one of
the terms in the arithmetic progression is divisible
by $q$, hence equal to $q$.
\end{proof}
In the table above, there is not a single example in which $q\nmid 2n$,
$M(2n)=q$ and $q$ is not the first prime in the arithmetic.
This suggests
\begin{question}
Let $q\nmid 2n$ be a prime and suppose
$M(2n)=q$.  Then must
$$q,\, q+2n,\,\ldots, \, q+2n(q-1)$$
all be prime?
\end{question}
The data also suggests the following
\begin{conjecture}
Both $M(2n)$ and $M_{\infty}(2n)$ are $\geq 2$ for all $n$.
\end{conjecture}
The conjecture that $M(2n)\geq 2$ is similar to Golbach's
conjecture. It asserts that any even integer is
the difference of two primes; the conjecture that
$M_{\infty}(2n)\geq 2$ asserts that this can be done in
infinitely many ways.
It seems conceivable that $M(2n!)$ is unbounded as
a function of $n$.