1 Introduction

Let \(a,b,\ell \) be integers with \(a>0\) and \(\ell \ge 2\), and write \(P_{a,b;N}(\ell )\) for the number of \(\ell \)-th powers among the first N terms \(b,\ldots ,a(N-1)+b\) of the arithmetic progression \(ax+b\) \((x\ge 0)\). Let \(P_N(\ell )\) be the maximum of these values taken over all arithmetic progressions \(ax+b\). The case of squares has been intensively studied. An old conjecture of Erdős [7] predicted that \(P_N(2)=o(N)\) should hold. This was proved by Szemerédi [17]. Later, the bound has been considerably improved. Bombieri, Granville and Pintz [2] showed that \(P_N(\ell )<O(N^{2/3+o(1)})\). This bound was refined to \(O(N^{3/5+o(1)})\) by Bombieri and Zannier [1]. Both papers applied deep methods based on elliptic and higher genus curves, Falting’s theorem, the distribution of primes and other ingredients; see also the neat short paper of Granville [10] for related results and remarks. In fact, there is a conjecture due to Rudin (see [12], end of paragraph 4.6) which predicts a much stronger behaviour of \(P_N(2)\), namely, that \(P_N(2)=O(\sqrt{N})\) should be valid. A stronger form of this conjecture even says that we have

$$\begin{aligned} P_N(2)=P_{24,1;N}(2)=\sqrt{\frac{8}{3}N}+O(1), \end{aligned}$$
(1)

for \(N\ge 6\). The first equality here has been recently verified to be true up to \(N\le 52\) by González-Jiménez and Xarles [9]. Note that by a classical result formulated by Fermat, with first published proof due to Euler, there are no four squares in arithmetic progression. This in view of the progression 1, 25, 49 implies the first equality in (1) for \(N\le 4\). (The case \(N=5\) is exceptional; for details, see [9].)

As far as we know, except for a few related remarks in [2], the case of general \(\ell \)-th powers has not been studied yet. In this paper we consider the problem in this generality. First we establish a theorem which completely describes the arithmetic progressions containing the most \(\ell \)-th powers asymptotically. It will turn out that for every \(\ell \ne 4\), this progression is unique (up to trivial transformations). In the case \(\ell =4\) there are two ‘best’ progressions. Based on this theorem, we suggest two problems, which are the extensions of Rudin’s conjecture to the case of general exponents \(\ell \). We think that the answer to the questions proposed is affirmative. To support this, using elliptic and higher genus curves we provide numerical results for \(\ell =3\) (up to \(N<20\)) and \(\ell =4\) (up to \(N<6\)).

The structure of the paper is the following. In the next section we give our principal result (together with its proof) and formulate our problems. Then in the last section we provide our numerical results supporting that the answer to our questions should be affirmative.

2 Arithmetic progressions containing the most \(\ell \)-th powers asymptotically

First we need to introduce some notation. Fix any exponent \(\ell \ge 2\). Let a be a positive integer (the difference of our progression), b be an integer, and put

$$\begin{aligned} S_{a,b}(\ell )=\lim \limits _{N\rightarrow \infty }\frac{|\{x:ax+b\ \text {is an}\ \ell \text {-th power},\ 0\le x<N\}|}{\root \ell \of {N}}. \end{aligned}$$

It is clear that for any \(\ell ,a,b\) this limit exists, but it will also be obvious from our arguments. So in particular, we have \(S_{a,b}(\ell )=O(\root \ell \of {N})\). Then we let

$$\begin{aligned} S_a(\ell )=\max _{b\in {\mathbb Z}} S_{a,b}(\ell ). \end{aligned}$$

Note that clearly, \(S_{a,b}(\ell )\) does not actually depend on b, only on the residue class of b modulo a. Thus the above maximum is taken only over a finite set, hence it exists. Finally, set

$$\begin{aligned} S(\ell )=\max _{a\in {\mathbb N}} S_a(\ell ). \end{aligned}$$

It is not that obvious that this maximum also exists. Our theorem below shows that \(S(\ell )\) actually exists, it even provides a precise formula for it, furthermore, it completely describes the arithmetic progressions on which it is taken.

For its smooth formulation we need a further notion. Let \(\ell \ge 2\) and let \(ax+b\) be an arithmetic progression. By an \(\ell \)-transformation of this progression we mean an arithmetic progression of the shape

$$\begin{aligned} (az^\ell )x+(b+ta)z^\ell , \end{aligned}$$

where z is a positive integer and t is an arbitrary integer.

Theorem 1

\(S{(\ell )}\) exists for any \(\ell \ge 2\) and we have

$$\begin{aligned} S(\ell )= {\left\{ \begin{array}{ll} \sqrt{\frac{8}{3}}&{}\text {if}\ \ell =2,\\ \underset{\frac{\log p}{\log p-\log (p-1)}>\ell }{\prod \limits _{p\ \text {prime},\ p-1\mid \ell ,}} (p-1)p^{\frac{1}{\ell }-1}&{}\text {otherwise}. \end{array}\right. } \end{aligned}$$

Further, for the arithmetic progression \(ax+b\) we have \(S_{a,b}(\ell )=S(\ell )\) if and only if it is an \(\ell \)-transformation of

$$\begin{aligned} a^*x+b^* \end{aligned}$$

with

$$\begin{aligned} a^*= {\left\{ \begin{array}{ll} 24&{}\text {if}\ \ell =2,\\ 5\ \text {or}\ 80&{}\text {if}\ \ell =4,\\ \underset{\frac{\log p}{\log p-\log (p-1)}>\ell }{\prod \limits _{p\ \text {prime},\ p-1\mid \ell ,}} p&{}\text {otherwise}, \end{array}\right. } \end{aligned}$$

and

$$\begin{aligned} b^*= {\left\{ \begin{array}{ll} 0&{}\text {if}\ a^*=1,\\ 1&{}\text {otherwise}. \end{array}\right. } \end{aligned}$$

Remarks

First note that clearly, we could take \(b^*=1\) for \(a^*=1\) as well. Our choice for \(b^*\) in the theorem in this case is just to keep the convention \(0\le b^*<a^*\).

Observe that for \(\ell \) odd, the products in the statement are empty, so we have

$$\begin{aligned} S(\ell )=a^*=1 \end{aligned}$$

in this case. That is, for odd values of \(\ell \), the ‘best’ progression (in the above sense) is the trivial one x, or any of its \(\ell \)-transformations. On the other hand, there are infinitely many even values of \(\ell \) with \(S(\ell )>1\) and \(a^*>1\). For example, taking \(\ell =p-1\) with any odd prime p, a simple calculation shows that \(p\mid a^*\) and \(S(\ell )\ge \ell (\ell +1)^{\frac{1}{\ell }-1}>1\).

We also mention that the expression \(\log p/(\log p-\log (p-1))\) appearing in the products above is strictly monotone increasing. So after a certain point all primes p with \(p-1\mid \ell \) will be included in these products. One can easily construct (even) values of \(\ell \) such that \(a^*\) is divisible ‘many’ primes. We omit the details, and just say that it could be interesting to explore further properties of the values \(a^*\) and the sequence \(S(\ell )\). As a concrete question, we propose the following. Is it true that

$$\begin{aligned} \lim \limits _{\ell \rightarrow \infty } S(\ell )=1\ ? \end{aligned}$$

We think that the answer is affirmative, and probably it is not that difficult to check this assertion.

Extending the problems and conjectures concerning \(\ell =2\) to the general case \(\ell \ge 2\), one may wonder whether the asymptotically ‘best’ progression for \(\ell \)-th powers is also the ‘best’ up to any N, or at least up to any N which is large enough. More precisely, we suggest the following problems.

Problem 1

For fixed \(\ell \ge 2\), for any arithmetic progression \(ax+b\) and \(N\ge 1\) set

$$\begin{aligned} P_{a,b;N}(\ell )=|\{x:ax+b\ \text {is an}\ \ell \text {-th power},\ 0\le x<N\}|. \end{aligned}$$

Is it true that there exists an \(N_0\) such that for any \(N>N_0\)

$$\begin{aligned} \max \limits _{a>0,\ b\ge 0} P_{a,b;N}(\ell )=P_{a^*,b^*;N}(\ell ) \end{aligned}$$

holds? Here for the special case \(\ell =4\) we use the convention that

$$\begin{aligned} P_{a^*,b^*;N}(4)=\max (P_{5,1;N}(4),P_{80,1;N}(4)). \end{aligned}$$

Problem 2

Use the notation from Problem 1, and for \(\ell \) odd and \(N\ge 1\) let \(b^\times \) be the largest \(\ell \)-th power being at most \((N-1)/2\), that is

$$\begin{aligned} b^\times =\left\lfloor \root \ell \of {\frac{N-1}{2}}\right\rfloor . \end{aligned}$$

Is it true that for any odd \(\ell \) there exists an \(N_0\) such that for any \(N>N_0\)

$$\begin{aligned} \max \limits _{a>0,\ b\in {\mathbb Z}} P_{a,b;N}(\ell )=P_{1,-b^\times ;N}(\ell ) \end{aligned}$$

holds?

Remarks

First we note that affirmative answers for the questions in the above problems would yield that

$$\begin{aligned} \max \limits _{a>0,\ b\in {\mathbb Z}} P_{a,b;N}(\ell )=O(\root \ell \of {N}), \end{aligned}$$

providing a positive answer to the conjecture of Rudin, extended to any exponent \(\ell \).

We also mention that in case of \(\ell =4\) none of the two ‘best’ progressions is ‘better’ than the other. In fact, though

$$\begin{aligned} |P_{5,1;N}(4)-P_{80,1;N}(4)|\le 1 \end{aligned}$$

for any N,

$$\begin{aligned} P_{5,1;N}(4)-P_{80,1;N}(4) \end{aligned}$$

changes sign infinitely often. These assertions can be easily verified. This is the reason of the exceptional case of \(\ell =4\) in Problem 1.

Our next point here concerns why we distinguish Problems 1 and 2. The reason is that when \(\ell \) is odd, then a shift to the negative direction may increase the value of \(P_{a,b;N}(\ell )\). For example, for \(\ell =3\), the progression \(x-1\) will contain more cubes then the progression x for \(x=0,1,\ldots ,N-1\), for any \(N\ge 1\). On the other hand, a shift into the positive direction does not seem to be ‘wise’ heuristically: the reason is that close to zero the ‘density’ of \(\ell \)-th powers is larger than away from zero. So it seems to be the best to keep b in the interval \(0\le b<a\) for given a in this case.

We mention that in Problem 1 one certainly needs to take \(N_0>2\), at least for many \(\ell \). Indeed, if \(a^*>1\) and \(a^*+1\) is not an \(\ell \)-th power then we have, e.g.

$$\begin{aligned} P_{1,0;2}(\ell )=2>1=P_{a^*,b^*;2}(\ell ). \end{aligned}$$

Finally, we note that in case of Problem 2 it might be the case that \(N_0=1\) is a good choice. However, here we do not have a fixed progression: we always (or at least time to time) ‘shift’ the ‘asymptotically best’ progression x to the left to get the ‘best’ progression for N: our \(b^\times \) depends also on N. (As \(\ell \) is odd, we know that now \(a^*=1\).)

We shall be concerned with Problems 1 and 2 in the next section, now we head forward the proof of Theorem 1. For this we shall need the following lemma. (See [11] Corollaries 2.42 and 2.44, or Lemma 6 of [8] for a formulation similar to the one below.)

Lemma 1

Let \(\ell \) and n be positive integers greater than one, and write \(U_\ell (n)\) for the number of \(\ell \)-th roots of unity modulo n. Further, let \(\nu _p(\ell )\) denote the exponent of a prime p in the factorization of \(\ell \).

  1. (i)

    We have \(U_\ell (2)=1\), and if \(\ell \) is odd, then \(U_\ell (2^\alpha ) = 1\) for any \(\alpha \ge 1\). If \(\ell \) is even, then we have

    $$\begin{aligned} U_\ell (2^\alpha )=2^{\min (\nu _2(\ell )+1,\alpha -1)} \end{aligned}$$

    for any \(\alpha \ge 2\).

  2. (ii)

    Let p be an odd prime. Then for any \(\alpha \ge 1\) we have

    $$\begin{aligned} U_\ell (p^\alpha )=p^{\min (\nu _p(\ell ),\alpha -1)}\gcd (\ell ,p-1). \end{aligned}$$

Proof of Theorem 1

Let ab be integers with \(a>0\). As we mentioned earlier, without loss of generality we may assume that \(0\le b<a\). In what follows, we shall always use this convention, unless stated differently. The total number of \(\ell \)-th powers between the first term b and the N-th term \(a(N-1)+b\) of the progression \(ax+b\) (\(x\ge 0\)) is clearly \(\root \ell \of {aN}+o(1)\). The question is that how many of these (roughly) \(\root \ell \of {aN}\) \(\ell \)-th powers belong to the progression \(ax+b\), for a given b. Obviously, any \(\ell \)-th power belongs to some progression \(ax+b\) with \(0\le b<a\). In what follows, we shall use these observations without any further mentioning.

To determine \(S_a(\ell )\) for given a, we should decide which is the ‘best’ choice for b. Clearly, those \(\ell \)-th powers \(u^\ell \) will belong to the progression \(ax+b\) for which

$$\begin{aligned} u^\ell \equiv b\pmod {a}. \end{aligned}$$

That is, we should find the b for which

$$\begin{aligned} M_{a,b}(\ell ):=|\{u:0\le u<a,\ u^\ell \equiv b\pmod {a}\}| \end{aligned}$$

is maximal. Write

$$\begin{aligned} M_a(\ell )=\max \limits _{0\le b<a} M_{a,b}(\ell ) \end{aligned}$$

for this maximum. Observe that these quantities are of utmost importance for us indeed, as we clearly have

$$\begin{aligned} S_{a,b}(\ell )=\frac{\frac{M_{a,b}(\ell )}{a}\root \ell \of {aN}}{\root \ell \of {N}}=M_{a,b}(\ell )a^{\frac{1}{\ell }-1} \end{aligned}$$

and hence

$$\begin{aligned} S_a(\ell )=M_a(\ell )a^{\frac{1}{\ell }-1}. \end{aligned}$$

To get \(S(\ell )\) for an arbitrary but fixed \(\ell \ge 2\), we need to maximize the above expression as a runs through \({\mathbb N}\).

We make two simple, but important observations. Firstly, note that we have

$$\begin{aligned} S(\ell )=\max \limits _{a\in {\mathbb N}}S_a(\ell ) \ge S_1(\ell )=M_1(\ell )\cdot 1^{{\frac{1}{\ell }}-1}=1, \end{aligned}$$

when our progression is just \(1\cdot x+0=x\). Secondly, observe that \(S_a(\ell )\), or equivalently, \(M_a(\ell )\) is multiplicative in a, for any fixed \(\ell \). To see this, write \(a=a_1a_2\) with \(\gcd (a_1,a_2)=1\). In this part of the argument it is more convenient to work with general \(b\in {\mathbb Z}\) instead of b-s with \(0\le b<a\). So let \(b\in {\mathbb Z}\) be such that \(M_a(\ell )=M_{a,b}(\ell )\). Clearly,

$$\begin{aligned} u^\ell \equiv b\pmod {a} \end{aligned}$$

if and only if

$$\begin{aligned} u^\ell \equiv b\pmod {a_1}\ \ \ \text {and}\ \ \ u^\ell \equiv b\pmod {a_2}. \end{aligned}$$

This by the Chinese Remainder Theorem shows that

$$\begin{aligned} M_a(\ell )=M_{a,b}(\ell )=M_{a_1,b}(\ell )M_{a_2,b}(\ell )\le M_{a_1}(\ell )M_{a_2}(\ell ). \end{aligned}$$
(2)

Let now \(b_1,b_2\in {\mathbb Z}\) be such that

$$\begin{aligned} M_{a_1}(\ell )=M_{a_1,b_1}(\ell )\ \ \ \text {and}\ \ \ M_{a_2}(\ell )=M_{a_2,b_2}(\ell ). \end{aligned}$$

Let b be such that

$$\begin{aligned} {\left\{ \begin{array}{ll} b\equiv b_1\pmod {a_1},\\ b\equiv b_2\pmod {a_2}. \end{array}\right. } \end{aligned}$$

Now if

$$\begin{aligned} u^\ell \equiv b_1\pmod {a_1}\ \ \ \text {and}\ \ \ v^\ell \equiv b_2\pmod {a_2}, \end{aligned}$$

and w is such that

$$\begin{aligned} {\left\{ \begin{array}{ll} w\equiv u\pmod {a_1},\\ w\equiv v\pmod {a_2} \end{array}\right. } \end{aligned}$$

then

$$\begin{aligned} w^\ell \equiv b\pmod {a}. \end{aligned}$$

This by the Chinese Remainder Theorem implies that

$$\begin{aligned} M_a(\ell )\ge M_{a,b}(\ell )\ge M_{a_1,b_1}(\ell )M_{a_2,b_2}(\ell )=M_{a_1}(\ell )M_{a_2}(\ell ). \end{aligned}$$
(3)

Then (2) and (3) together give

$$\begin{aligned} M_a(\ell )=M_{a_1}(\ell )M_{a_2}(\ell ), \end{aligned}$$

so \(M_a(\ell )\) is multiplicative, indeed. As we clearly also have

$$\begin{aligned} S_a(\ell )=M_a(\ell )a^{\frac{1}{\ell }-1}=M_{a_1}(\ell )M_{a_2}(\ell ){a_1}^{\frac{1}{\ell }-1}{a_2}^{\frac{1}{\ell }-1}=S_{a_1}(\ell )S_{a_2}(\ell ), \end{aligned}$$

we see that \(S_a(\ell )\) is multiplicative, as well.

Thus to find \(S(\ell )\), and the a-s which provide

$$\begin{aligned} S(\ell )=S_a(\ell ), \end{aligned}$$

and ultimately the b-s which provide

$$\begin{aligned} S_a(\ell )=S_{a,b}(\ell ) \end{aligned}$$

for these a-s, we may restrict our attention to arithmetic progressions \(ax+b\) with \(a=p^\alpha \) and

$$\begin{aligned} S_{p^\alpha ,b}(\ell )\ge 1. \end{aligned}$$

From this point on we switch back to use the convention \(0\le b<a\) again. (As \(S_{a,b}(\ell )\) and \(M_{a,b}(\ell )\) depend on b only through its residue modulo a, we can do that without any problem.) For any b with \(0\le b<p^\alpha \), by the definition of \(M_{p^\alpha ,b}(\ell )\) there exist integers

$$\begin{aligned} 0\le u_1<\cdots<u_{M_{p^\alpha ,b}(\ell )}<p^\alpha \end{aligned}$$

such that

$$\begin{aligned} u_1^\ell \equiv \dots \equiv u_{M_{p^\alpha ,b}(\ell )}^\ell \equiv b\pmod {p^\alpha }. \end{aligned}$$
(4)

To find those values of \(p^\alpha \) and b for which \(S_{p^\alpha ,b}(\ell )\ge 1\), we distinguish three cases.

CASE 1. Suppose first that \(p\not \mid b\). Then of course we also have \(p\not \mid u_i\) \((i=1,\ldots ,M_{p^\alpha ,b}(\ell ))\). Thus multiplying the sequence of congruences (4) with \(u_1^{-\ell }\) modulo \(p^\alpha \), we see that \(M_{p^\alpha ,b}(\ell )=M_{p^\alpha ,1}(\ell )\). So for any b with \(p\not \mid b\) Lemma 1 shows that

$$\begin{aligned} S_{p^\alpha ,b}(\ell )= {\left\{ \begin{array}{ll} 2^{\alpha \left( \frac{1}{\ell }-1\right) }&{}\text {if}\ p=2\ \text {and}\ \ell \ \text {is odd},\\ 2^{\min (\nu _2(\ell )+1,\alpha -1)}\cdot 2^{\alpha \left( \frac{1}{\ell }-1\right) }&{}\text {if}\ p=2\ \text {and}\ \ell \ \text {is even},\\ p^{\min (\nu _p(\ell ),\alpha -1)}\gcd (\ell ,p-1)\cdot p^{\alpha \left( \frac{1}{\ell }-1\right) }&{}\text {if}\ p\ \text {is an odd prime}. \end{array}\right. } \end{aligned}$$
(5)

We (naturally) distinguish two subcases. Take first \(p=2\). If \(S_{p^\alpha ,b}(\ell )\ge 1\) then by (5) we clearly have that \(\ell \) is even, \(\alpha >1\) and

$$\begin{aligned} \min (\nu _2(\ell )+1,\alpha -1)+\alpha \left( \frac{1}{\ell }-1\right) \ge 0. \end{aligned}$$
(6)

If

$$\begin{aligned} \nu _2(\ell )+1\ge \alpha -1 \end{aligned}$$

then on the one hand

$$\begin{aligned} \ell \ge 2^{\alpha -2}, \end{aligned}$$

and on the other hand, by (6)

$$\begin{aligned} \alpha \ge \ell . \end{aligned}$$

Hence we get that

$$\begin{aligned} (p^\alpha ,\ell )=(4,2),\ (8,2),\ (16,4) \end{aligned}$$

in this case, with equality in (6) for the first and third pairs and strict inequality in (6) for the second one. Otherwise, if

$$\begin{aligned} \nu _2(\ell )+1<\alpha -1 \end{aligned}$$

then as (6) implies

$$\begin{aligned} \nu _2(\ell )+\frac{\alpha }{\ell }\ge \alpha -1, \end{aligned}$$
(7)

we get

$$\begin{aligned} \alpha >\ell . \end{aligned}$$

As \(\ell \ge 2^{\nu _2(\ell )}\) this gives

$$\begin{aligned} \nu _2(\ell )<\frac{\log \alpha }{\log 2}. \end{aligned}$$

So as \(\ell \ge 2\), inequality (7) by a simple calculation yields that \(\alpha \le 8\). Hence we easily get that the only possible value of \(p^\alpha \) and \(\ell \) with \(S_{p^\alpha }(\ell )\ge 1\) is given by

$$\begin{aligned} (p^\alpha ,\ell )=(16,2), \end{aligned}$$

when in fact we have \(S_{16}(2)=1\).

Let now p be an odd prime. Then by (5) we know that \(S_{p^\alpha ,b}(\ell )\ge 1\) if and only if

$$\begin{aligned} \min (\nu _p(\ell ),\alpha -1)+\log _p \gcd (\ell ,p-1)+\alpha \left( \frac{1}{\ell }-1\right) \ge 0. \end{aligned}$$
(8)

Suppose first that

$$\begin{aligned} \nu _p(\ell )\ge \alpha . \end{aligned}$$
(9)

Then (8) implies that

$$\begin{aligned} p^\alpha \ge \left( \frac{p}{\gcd (\ell ,p-1)}\right) ^\ell , \end{aligned}$$

whence by (9)

$$\begin{aligned} \ell \ge \left( \frac{p}{\gcd (\ell ,p-1)}\right) ^\ell . \end{aligned}$$

This gives that

$$\begin{aligned} \frac{p}{\gcd (\ell ,p-1)}<2, \end{aligned}$$

therefore

$$\begin{aligned} \gcd (\ell ,p-1)=p-1, \end{aligned}$$

that is

$$\begin{aligned} p-1\mid \ell . \end{aligned}$$

Write \(\ell =t(p-1)\) with \(t\ge 1\), and let \(t=p^\beta s\) with \(p\not \mid s\). Thus, obviously, \(\nu _p(\ell )=\beta \). In view of (9), as \(\alpha \ge 1\), we have \(\beta \ge 1\). Hence from (8) and (9) we obtain

$$\begin{aligned} \frac{\beta }{p^\beta s(p-1)}\ge \log _p \frac{p}{p-1}, \end{aligned}$$

so

$$\begin{aligned} \frac{\beta \log p}{p^\beta }\ge \log \left( 1+\frac{1}{p-1}\right) ^{p-1}. \end{aligned}$$

As \(\beta \ge 1\), a simple calculation yields that the above inequality is impossible, so we cannot have \(S_{p^\alpha }(\ell )\ge 1\) in this case.

Suppose next that

$$\begin{aligned} \nu _p(\ell )<\alpha . \end{aligned}$$
(10)

Then (as \(\nu _p(\ell )\le \alpha -1\)) (8) implies that

$$\begin{aligned} \nu _p(\ell )+\log _p\gcd (\ell ,p-1)+\alpha \left( \frac{1}{\ell }-1\right) \ge 0. \end{aligned}$$
(11)

If we would have \(\nu _p(\ell )+1<\alpha \), then certainly \(\nu _p(\ell )+2\le \alpha \), which by the above inequality yields

$$\begin{aligned} \log _p\gcd (\ell ,p-1)+\frac{\alpha }{\ell }\ge 2. \end{aligned}$$

Hence

$$\begin{aligned} \alpha >\ell \end{aligned}$$

in this case. As \(\ell \ge 3^{\nu _p(\ell )}\), this gives

$$\begin{aligned} \frac{\log \alpha }{\log 3}>\nu _p(\ell ). \end{aligned}$$

Then using (11) we easily obtain a contradiction. That is, we are left with the only possibility

$$\begin{aligned} \alpha =\nu _p(\ell )+1. \end{aligned}$$

Then (11) implies that

$$\begin{aligned} \frac{\nu _p(\ell )+1}{\ell }\ge \log _p \frac{p}{\gcd (\ell ,p-1)}. \end{aligned}$$

Set \(d=\gcd (\ell ,p-1)\), \(\ell =dt\) and \(t=p^\beta s\) with \(p\not \mid s\). Then we have

$$\begin{aligned} \frac{\beta +1}{dp^\beta s}\ge \log _p \frac{p}{d}. \end{aligned}$$
(12)

We show that (12) implies that \(\beta =0\). For this, observe that for any \(\beta \ge 1\) we have

$$\begin{aligned} \frac{2}{dp}\ge \frac{\beta +1}{dp^\beta s}. \end{aligned}$$

So to prove that (12) implies \(\beta =0\) indeed, it is sufficient to check that

$$\begin{aligned} g_p(d):=1-\frac{\log d}{\log p}-\frac{2}{dp}>0 \end{aligned}$$

for any odd prime p and \(1\le d\le p-1\). Taking the derivative (in d) of \(g_p(d)\), one can easily see that \(g_p(d)\) is strictly monotone decreasing in d (even as a positive real variable). So to check the above inequality, it is sufficient to verify that

$$\begin{aligned} g_p(p-1)=1-\frac{\log (p-1)}{\log p}-\frac{2}{(p-1)p}>0. \end{aligned}$$

We rewrite the above inequality as

$$\begin{aligned} \log \left( 1+\frac{1}{p-1}\right) ^{p-1}>\frac{2\log p}{p}. \end{aligned}$$

Since the left-hand side is strictly monotone increasing (and tends to 1) while the right-hand side is strictly monotone decreasing (and tends to 0), and the assertion is valid for \(p=3\), our claim follows. That is, we get \(\beta =0\), whence \(\nu _p(\ell )=0\) and \(\alpha =1\). So (12) reads as

$$\begin{aligned} \frac{1}{ds}\ge \log _p\frac{p}{d}. \end{aligned}$$

We show that it is possible only for \(d=p-1\). Observe that \(d=1\) can be immediately excluded, since then by \(\ell \ge 2\), \(s>1\) must hold. Thus the case \(p=3\) is done: then we can only have \(d=p-1=2\). So it is sufficient to prove that

$$\begin{aligned} h_p(d):=1-\frac{1}{d}-\frac{\log d}{\log p}>0 \end{aligned}$$

for all odd primes p with \(p\ge 5\) and d with \(2\le d\le (p-1)/2\). Taking the derivative of \(h_p(d)\) in d, we get that it it is strictly monotone increasing for \(2\le d<\log p\) and strictly monotone decreasing for \(d>\log p\). Thus to show our claim, we only need to verify that

$$\begin{aligned} h_p(2)>0\ \ \ \text {and}\ \ \ h_p\left( \frac{p-1}{2}\right) >0, \end{aligned}$$

that is

$$\begin{aligned} \frac{1}{2}-\frac{\log 2}{\log p}>0\ \ \ \text {and}\ \ \ 1-\frac{2}{p-1}-\frac{\log (p-1)-\log 2}{\log p}>0, \end{aligned}$$

respectively. Recalling that \(p\ge 5\), the first inequality trivially holds. The second inequality can be directly checked for \(p=5\), and for \(p\ge 7\) it immediately follows from the stronger assertion

$$\begin{aligned} (p-1)\log 2-2\log p>0 \end{aligned}$$

which is easy to check. That is, altogether we get that \(d=p-1\) must hold. Thus (12) gives

$$\begin{aligned} \ell \le \frac{\log p}{\log p-\log (p-1)}. \end{aligned}$$

Summarizing, \(S_{p^\alpha ,b}(\ell )\ge 1\) for an odd prime p for some b with \(p\not \mid b\) if and only if the following properties hold

$$\begin{aligned} \alpha =1,\ \ \ p\not \mid \ell ,\ \ \ p-1\mid \ell ,\ \ \ \frac{\log p}{\log p-\log (p-1)}\ge \ell , \end{aligned}$$

and \(S_{p^\alpha }(\ell )>1\) precisely when the inequality is strict in the last point. A simple calculation shows that the last two assertions imply the second one. Indeed, if both \(p-1\mid \ell \) and \(p\mid \ell \) would hold, then writing \(\ell =\ell _0p(p-1)\), the last assertion would give

$$\begin{aligned} \log \left( 1+\frac{1}{p-1}\right) ^{p-1}\le \frac{\log p}{\ell _0 p} \end{aligned}$$

with \(\ell _0\ge 1\). However, this does not hold for \(p\ge 3\). Further, observe that we cannot have equality in the last assertion. That is, altogether we have that \(S_{p^\alpha ,b}(\ell )\ge 1\) for an odd prime p for some b with \(p\not \mid b\) if and only if

  1. (i)

    \(\alpha =1\),

  2. (ii)

    \(p-1\mid \ell \),

  3. (iii)

    \(\frac{\log p}{\log p-\log (p-1)}>\ell \).

Further, if (i), (ii), (iii) are valid then in fact we have with \(S_{p^\alpha }(\ell )>1\).

To close this case, we make the following simple, but important observation. If \(S_{p^\alpha ,b}(\ell )\ge 1\) with \(p\not \mid b\) then we have \(b=1\) with the sole exception of \((p^\alpha ,\ell ,b)=(16,2,9)\). This can be directly checked for \(p=2\). When \(p\ge 3\), then recalling \(\alpha =1\), this assertion follows by noting that as \(p-1\mid \ell \), we have

$$\begin{aligned} u^\ell \equiv 1\pmod {p} \end{aligned}$$

whenever \(p\not \mid u\).

CASE 2. Consider next the case where \(p\mid b\), but \(b\ne 0\). Then writing \(u_1=p^\beta v_1\) with \(p\not \mid v_1\) in (4), we clearly have \(\ell \beta <\alpha \) and certainly also \(u_i=p^\beta v_i\) with \(p\not \mid v_i\) \((i=1,\ldots ,M_{p^\alpha ,b}(\ell ))\). Thus

$$\begin{aligned} v_1^\ell \equiv \dots \equiv v_{M_{p^\alpha ,b}(\ell )}^\ell \equiv b'\pmod {p^{\alpha -\ell \beta }} \end{aligned}$$

where \(b'=b/p^{\ell \beta }\), that is, this case is reduced to CASE 1. There are precisely \(M_{p^{\alpha -\ell \beta },b'}(\ell )\) such \(v_i\)-s modulo \(p^{\alpha -\ell \beta }\). Hence as we may assume that \(v_i<p^{\alpha -\beta }\) \((i=1,\ldots ,M_{p^\alpha ,b}(\ell ))\), we conclude that

$$\begin{aligned} M_{p^\alpha ,b}(\ell )=M_{p^{\alpha -\ell \beta },b'}(\ell )p^{(\ell -1)\beta }. \end{aligned}$$
(13)

We distinguish two cases. If \(p=2\) then (13) by (5) gives

$$\begin{aligned} S_{p^\alpha ,b}(\ell )= {\left\{ \begin{array}{ll} 2^{(\ell -1)\beta }\cdot 2^{\alpha \left( \frac{1}{\ell }-1\right) }&{}\text {if}\ \ell \ \text {is odd},\\ 2^{\min (\nu _2(\ell )+1,\alpha -\ell \beta -1)}\cdot 2^{(\ell -1)\beta }\cdot 2^{\alpha \left( \frac{1}{\ell }-1\right) }&{}\text {if}\ \ell \ \text {is even}. \end{array}\right. } \end{aligned}$$

This shows that if \(S_{p^\alpha ,b}(\ell )\ge 1\) in this case, then \(\ell \) must be even. If \(\ell \) is even, then we get

$$\begin{aligned} S_{p^\alpha ,b}(\ell )= 2^{\min (\nu _2(\ell )+1,\alpha -\ell \beta -1)}\cdot 2^{(\alpha -\ell \beta )\left( \frac{1}{\ell }-1\right) }=S_{p^{\alpha -\ell \beta },1}(\ell ). \end{aligned}$$

In the second equality we used what we got in CASE 1. So applying again our results obtained in CASE 1, we get that \(S_{p^\alpha ,b}(\ell )\ge 1\) in this case implies that we have one of

$$\begin{aligned} (p^{\alpha -\ell \beta },\ell )=(4,2),\ (8,2),\ (16,2),\ (16,4), \end{aligned}$$

and \(S_{p^\alpha ,b}(\ell )>1\) only in the second case. Further, \(b=2^{\ell \beta }\) in all cases except the third one, when \(b=9\cdot 2^{\ell \beta }\) is also possible.

Let now \(p>2\). Then (13) through (5) gives

$$\begin{aligned}&S_{p^\alpha ,b}(\ell )=p^{\min (\nu _p(\ell ),\alpha -\ell \beta -1)}\gcd (\ell ,p-1) p^{\alpha \left( \frac{1}{\ell }-1\right) }p^{(\ell -1)\beta }\\&\qquad \quad \quad \quad =p^{\min (\nu _p(\ell ),\alpha -\ell \beta -1)}\gcd (\ell ,p-1) p^{(\alpha -\ell \beta )\left( \frac{1}{\ell }-1\right) }. \end{aligned}$$

Thus by what we have proved in CASE 1, \(S_{p^\alpha ,b}(\ell )\ge 1\) implies that \(\alpha -\ell \beta =1\) and \(b=p^{\ell \beta }\), and p satisfies the points (ii) and (iii) at the end of CASE 1. In fact, for these values of the parameters we have \(S_{p^\alpha ,b}(\ell )>1\).

CASE 3. Finally, assume that \(p^\alpha \mid b\), that is, \(b=0\). Then in (4), \(u_1,\ldots ,u_{M_{p^\alpha ,0}(\ell )}\) are just the multiples of \(p^{\lceil \alpha /\ell \rceil }\). Thus \(M_{p^\alpha ,0}(\ell )=p^{\alpha -\lceil \alpha /\ell \rceil }\) and we have

$$\begin{aligned} S_{p^\alpha ,0}(\ell )\le 1, \end{aligned}$$

with equality if and only if \(\ell \mid \alpha \).

Now we can build the ‘best’ modulus a, and even the ‘best’ arithmetic progressions \(ax+b\) based on the information we gained. For given \(\ell \), in view of that \(S_a(\ell )\) is multiplicative, if

$$\begin{aligned} S(\ell )=S_a(\ell ) \end{aligned}$$

then a must be divisible by all prime powers \(p^\alpha \) for which \(S_{p^\alpha }(\ell )>1\). By what we have proved so far, if we take a to be the product of these prime powers (taking e.g. the smallest possible exponent for all these primes) then \(S_a(\ell )\) is maximal indeed; in particular, \(S(\ell )\) exists, and its value is just what is given in the statement. To show that the ‘best’ a is essentially unique, we need some further discussion. From CASE 1 we see that for \(\ell =4\) there are two possible choices for the ‘best’ a, given by \(a^*=5,80\), while in all the other cases from here we get only one possibility, given by \(a^*=2^3\cdot 3=24\) for \(\ell =2\) and

$$\begin{aligned} a^*=\underset{p-1\mid \ell ,\ \frac{\log p}{\log p-\log (p-1)}>\ell }{\prod \limits _{p\ \text {is an odd prime}}} p \end{aligned}$$

for the other choices of \(\ell \). In all cases with \(a^*\ne 1\) we have \(b=b^*=1\). When \(a^*=1\), we could choose b freely. We take \(b=b^*=0\) in this case, to keep our convention \(0\le b<a\). Observe that in the above expression for \(a^*\), the condition that the prime p is odd in the product is superfluous: the inequality \(\log p/(\log p-\log (p-1))>\ell \) does not hold with \(p=2\) for any \(\ell \). So these parameters just provide the progressions in the statement. Observe that CASES 2 and 3 show that these progressions (both \(a^*\) and \(b^*\)) can be multiplied by any \(\ell \)-th power, and then the value \(S_{a^*,b^*}(\ell )\) just remains unchanged. Note that this is obvious: \(a^*x+b^*\) is an \(\ell \)-th power if and only if \((a^*z^\ell )x+b^*z^\ell \) is an \(\ell \)-th power (for \(x\ge 0\)), for any \(z\ge 1\). Finally, as we already noted, \(S_{a^*,b^*}(\ell )\) depends on \(b^*\) only through its residue class modulo \(a^*\), so \(b^*\) can be shifted by any multiple of \(a^*\). Hence the theorem follows. \(\square \)

3 Numerical results concerning Problems 1 and 2

In this section we deal with Problems 1 and 2, for \(\ell =3,4\) for small values of N. We shall start with Problem 2 in case of \(\ell =3\), with \(N<20\). For these values of N Problem 2 suggests that the ‘best’ progression (containing the most cubes among its first N terms \(b,\ldots ,a(N-1)+b\)) is given by \(a=1\) and \(b=-b^\times \), with

$$\begin{aligned} b^\times =\left\lfloor \root \ell \of {\frac{N-1}{2}}\right\rfloor . \end{aligned}$$

In particular, for \(N<20\) we have

$$\begin{aligned} b=-b^\times = {\left\{ \begin{array}{ll} 0&{}\text {if}\ N=1,2\\ -1&{}\text {if}\ 3\le N\le 16,\\ -8&{}\text {if}\ 17\le N<20, \end{array}\right. } \end{aligned}$$

and the number of cubes in these progressions among the first N terms are given by

$$\begin{aligned} P_{1,-b^\times ;N}(3)= {\left\{ \begin{array}{ll} 1&{}\text {if}\ N=1,\\ 2&{}\text {if}\ N=2,\\ 3&{}\text {if}\ 3\le N\le 9,\\ 4&{}\text {if}\ 10\le N\le 16,\\ 5&{}\text {if}\ 17\le N<20. \end{array}\right. } \end{aligned}$$
(14)

Our first result in this section verifies that the above progressions are really the ‘best’ for \(N<20\), hence providing an affirmative answer for Problem 2 in these cases.

Theorem 2

Let ab be integers with \(a>0\). Then for any \(N<20\) we have

$$\begin{aligned} P_{a,b;N}(3)\le P_{1,-b^\times ;N}(3). \end{aligned}$$

Proof

For \(N\le 3\) the statement is obvious, so we may assume that \(4\le N\le 19\). To prove the statement, by (14) we need to check that

$$\begin{aligned} P_{a,b;N}(3)\le {\left\{ \begin{array}{ll} 3&{}\text {if}\ 4\le N\le 9,\\ 4&{}\text {if}\ 10\le N\le 16,\\ 5&{}\text {if}\ 17\le N<20. \end{array}\right. } \end{aligned}$$

So it is natural to split the proof into three subcases.

Suppose first that \(4\le N\le 9\), and assume to the contrary that among the first N terms of the progressions there are four cubes. Then there exist integers \(n_0,n_1,n_2,n_3\) with \(0\le n_0<n_1<n_2<n_3<N\) such that

$$\begin{aligned} an_i+b=x_i^3\ \ \ (i=0,1,2,3) \end{aligned}$$
(15)

with some integers \(x_0,x_1,x_2,x_3\). The system (15) yields four genus one curves of the form

$$\begin{aligned} (n_j-n_i)X^3+(n_i-n_k)Y^3+(n_k-n_j)Z^3=0, \end{aligned}$$
(16)

where \(0\le i<j<k\le 3\). We shall check all the possible systems (15). However, some of them can be easily excluded. First, observe that if the indices \(n_i,n_j,n_k\) form an arithmetic progression, then the corresponding genus one curve (16) is just

$$\begin{aligned} X^3-2Y^3+Z^3=0. \end{aligned}$$

By a classical result of Dénes [6] we know that this equation has the only solutions

$$\begin{aligned} (X,Y,Z)=(-u,0,u), (u,u,u)\ \quad (u\in {\mathbb Z}). \end{aligned}$$

So by \(N\le 9\), in this case we cannot have four cubes among the first N terms of our progression. That is, we may assume that \(n_0,n_1,n_2,n_3\) does not contain an arithmetic progression. By symmetry, we may clearly assume further that \(n_3-n_2\ge n_1-n_0\), moreover, by shifting the terms that \(n_0=0\), too. There are 18 quadruples \((n_0,n_1,n_2,n_3)\) with \(0\le n_0<n_1<n_2<n_3\le 8\) with these properties. If we can exclude them all, then we may conclude that our statement is valid for \(4\le N\le 9\) indeed. For such a given tuple \((n_0,n_1,n_2,n_3)\) (recalling that we may assume that \(n_0=0\)) we get three genus one curves as follows:

$$\begin{aligned} C_1:\quad n_1x_2^3-n_2x_1^3+(n_2-n_1)x_0^3= & {} 0,\\ C_2:\quad n_1x_3^3-n_3x_1^3+(n_3-n_1)x_0^3= & {} 0,\\ C_3:\quad n_2x_3^3-n_3x_2^3+(n_3-n_2)x_0^3= & {} 0. \end{aligned}$$

In fact we could get a fourth equation as well, however, that is a consequence of the above three ones. We use ideas from [4] (see p. 293) to construct genus two quotients of curves defined by two equations from the above system. Define morphisms

$$\begin{aligned} \zeta _0:(x_0:x_1:x_2:x_3)\rightarrow & {} (\zeta x_0:x_1:x_2:x_3),\\ \zeta _1:(x_0:x_1:x_2:x_3)\rightarrow & {} (x_0:\zeta x_1:x_2:x_3),\\ \zeta _2:(x_0:x_1:x_2:x_3)\rightarrow & {} (x_0:x_1:\zeta x_2:x_3),\\ \zeta _3:(x_0:x_1:x_2:x_3)\rightarrow & {} (x_0:x_1:x_2:\zeta x_3), \end{aligned}$$

where \(\zeta \) denotes a primitive cube root of unity. We will use subgroups of the form \(H_{i,j}=\langle \zeta _0\zeta _i,\zeta _0\zeta _j\rangle \) with \(1\le i<j\le 3\). For example, if we take the first two genus one curves \(C_1\) and \(C_2\) defined above with the subgroup \(H_{1,2}=\langle \zeta _0\zeta _1,\zeta _0\zeta _2\rangle \), then the corresponding quotient is isomorphic to the genus two hyperelliptic curve given by

$$\begin{aligned}&C^{1,2}_{H_{1,2}}:\quad y^2=((n_2 - n_1)(n_3 - n_1)n_3)^2x^6\\&\quad \quad \quad \quad \quad \quad \quad +2((n_3 - n_1)n_3)^2(2n_1n_2 - n_1n_3 - n_2n_3)x^3+((n_3 - n_1)n_3^2)^2. \end{aligned}$$

For given \(n_1,n_2,n_3\) one can compute the quotient by using the Magma [3] procedure CurveQuotient and having many numerical examples the general pattern is not too difficult to guess based on the concrete cases (the coefficient of \(x^6\) is a square and the constant term is a square) and to prove afterwards. We note that \((1,(n_3 - n_1)(n_1 + n_2 - n_3)n_3)\) is a point on \(C^{1,2}_{H_{1,2}}\) (and similarly, we can always find a parametric point on the other curves arising), so we cannot use local arguments to eliminate cases. We use the following strategy. For every tuple \((n_0,n_1,n_2,n_3)\) we construct all genus two curves \(C^{i,j}_{H_{k,m}}\) with \(i,j,k,m\in \{1,2,3\}\), \(i<j\), \(k<m\) and select those having Mordell–Weil group of rank at most one. For these curves we can apply the classical Chabauty’s method [5] to determine all rational points. For this, and all the other computations we use the program package Magma [3]. We provide some details only for \((n_0,n_1,n_2,n_3)=(0,1,3,8)\), the other cases are similar. We obtain the three genus one curves

$$\begin{aligned} C_1:\quad x_2^3-3x_1^3+2x_0^3= & {} 0,\\ C_2:\quad x_3^3-8x_1^3+7x_0^3= & {} 0,\\ C_3:\quad 3x_3^3-8x_2^3+5x_0^3= & {} 0. \end{aligned}$$

We get the hyperelliptic curve

$$\begin{aligned} C^{1,2}_{H_{1,2}}: y^2=12544x^6-163072x^3+200704, \end{aligned}$$

which is isomorphic to

$$\begin{aligned} C': y^2=784x^6 - 10192x^3 + 12544. \end{aligned}$$

Based on Stoll’s articles [14,15,16] one computes generators for the Mordell–Weil group. We get that the rank of the Jacobian of the curve is one and

$$\begin{aligned} \text{ Jac }(C')(\mathbb {Q})=\langle (x^2, -112, 2),(x, 28x^3 + 112, 2),(x - 1, 28x^3 - 84, 2)\rangle , \end{aligned}$$

where the first two generators are of order three and the last generates the free part. A standard application of Chabauty’s method yields that the only affine rational points on \(C'\) are given by

$$\begin{aligned} \{(0,\pm 112),(1,\pm 56)\}. \end{aligned}$$

These points do not give rise to non-constant arithmetic progressions. In a similar way we could eliminate all the other possible quadruples \((n_0,n_1,n_2,n_3)\).

Suppose next that \(10\le N\le 16\), and assume to the contrary of our claim that among the first N terms of a progression \(ax+b\) there are five cubes. Then there exist integers \(n_0,n_1,n_2,n_3,n_4\) with \(0\le n_0<n_1<n_2<n_3<n_4<N\) such that

$$\begin{aligned} an_i+b=x_i^3\ \ \ (i=0,1,2,3,4) \end{aligned}$$
(17)

with some integers \(x_0,x_1,x_2,x_3,x_4\). Following the steps provided in the case \(4\le N\le 9\), we obtain the six genus one curves

$$\begin{aligned} C_1:\quad (n_1-n_0)x_2^3+(n_0-n_2)x_1^3+(n_2-n_1)x_0^3= & {} 0,\\ C_2:\quad (n_1-n_0)x_3^3+(n_0-n_3)x_1^3+(n_3-n_1)x_0^3= & {} 0,\\ C_3:\quad (n_2-n_0)x_3^3+(n_0-n_3)x_2^3+(n_3-n_2)x_0^3= & {} 0,\\ C_4:\quad (n_1-n_0)x_2^3+(n_0-n_4)x_1^3+(n_4-n_1)x_0^3= & {} 0,\\ C_5:\quad (n_2-n_0)x_2^3+(n_0-n_4)x_1^3+(n_4-n_2)x_0^3= & {} 0,\\ C_6:\quad (n_3-n_0)x_2^3+(n_0-n_4)x_1^3+(n_4-n_3)x_0^3= & {} 0. \end{aligned}$$

In fact, we could get more curves, but these are sufficient for our purposes. Using the same morphisms and subgroups \(H_{i,j}=\langle \zeta _0\zeta _i,\zeta _0\zeta _j\rangle \) as earlier, we construct genus two curves. If we can find the rational points on one of these curves, then we are finished. However, to do this can be rather troublesome. The question is how to select the ‘right’ curves for which the computation is feasible and relatively fast. We applied the following method. For a given tuple \((n_0,n_1,n_2,n_3,n_4)\) we considered the collection of genus two curves described above. We computed an upper bound for the rank of the Mordell–Weil group by the Magma procedure \(\texttt {RankBounds}\). If the bound was larger than one, or the computation took more than three minutes (when it was interrupted) then we put the curve into a set called ‘BadCurves’. Otherwise we computed the Minkowski bound for the maximal order of the number field defined by the degree six polynomial related to the genus two curve and we determined the height constant bound corresponding to the naive height and the canonical height. In the first round we only considered curves with Minkowski bound less than 40,000 and height constant at most 16. Having a curve satisfying all the previous conditions we tried to determine generators of the Mordell–Weil group and apply Chabauty’s method. Again, we stopped the computation after three minutes if no output had appeared and we enlarged the set ‘BadCurves’. If everything went fine, i.e. the rank of the curve (quickly) proved to be at most one, then we included the curve into the set ‘GoodCurves’ to speed up later computations. In this way, in case of every tuple \((n_0,n_1,n_2,n_3,n_4)\) we could find an arising curve for which all its rational points could be determined. We found that these points do not lead to any arithmetic progression with the required properties, and our statement follows also in this case.

Finally, when \(17\le N\le 19\), then we may already assume that there are at least six cubes among the first N terms of the progression. In this case we followed the method described in the previous situation. We omit the details, and only mention that now we selected curves having Minkowski bound less than 300,000 and height constant bound at most 22. Ultimately, we could exclude all the tuples \((n_0,\ldots ,n_5)\), so we came to a similar conclusion also in this case as before.

The total computational time was 16.6 h on a Core I7 computer. As a result of them, we concluded that the theorem is valid. \(\square \)

Now we turn to Problem 1 in case of \(\ell =4\). For this value of \(\ell \) Problem 1 suggests that there are two ‘best’ progressions (containing the most fourth powers among its first N terms \(b,\ldots ,a(N-1)+b\)), given by \((a,b)=(5,1)\) and (80, 1). A simple calculation shows that for \(1\le N\le 5\) we have

$$\begin{aligned} P_{5,1;N}(4)\le P_{80,1;N}(4), \end{aligned}$$

and the number of fourth powers in the latter progression among its first N terms is given by

$$\begin{aligned} P_{80,1;N}(4)= {\left\{ \begin{array}{ll} 1&{}\text {if}\ N=1,\\ 2&{}\text {if}\ 2\le N\le 5. \end{array}\right. } \end{aligned}$$
(18)

Our last result verifies that this progression is the ‘best’ indeed for \(N\le 5\), hence providing an affirmative answer for Problem 1 for these values of N. In fact we prove more: we allow the initial term b of the progression be an arbitrary integer. The reason that in this case we go only up to \(N\le 5\) is that following a similar method as in the proof of Theorem 2, we just could not handle some cases (curves) appearing for \(N=6\).

Theorem 3

Let ab be integers with \(a>0\). Then for any \(N\le 5\) we have

$$\begin{aligned} P_{a,b;N}(4)\le P_{80,1;N}(4). \end{aligned}$$

Proof

The statement is obvious for \(N=1,2\), so we may assume that \(3\le N\le 5\). In view of (18), we need to show that

$$\begin{aligned} P_{a,b;N}(4)\le 2 \end{aligned}$$

for these values of N. Assume to the contrary that for a progression \(ax+b\) there are at least three fourth powers among its first N terms \((3\le N\le 5)\). So let \((n_0,n_1,n_2)\) with \(0\le n_0<n_1<n_2\le N\) be such that

$$\begin{aligned} an_i+b=x_i^4\ \ \ (i=0,1,2). \end{aligned}$$
(19)

If \(n_0,n_1,n_2\) is an arithmetic progression, then we get

$$\begin{aligned} x_0^4+x_2^4=2x_1^4. \end{aligned}$$

Again, by the classical result of Dénes [6] implies that then \(x_0=x_1=x_2\), a contradiction. So by symmetry, we may assume that we only need to consider the cases

$$\begin{aligned} (n_0,n_1,n_2)=(0,1,3),(0,1,4). \end{aligned}$$

We shall handle these tuples separately. However, before that it is important to show that here without loss of generality we may assume that \(x_0,x_1,x_2\) are pairwise coprime. (It will play an important technical role in our arguments below.) First we show that we may restrict our attention to coprime arithmetic progressions, i.e. to the case \(\gcd (a,b)=1\). For this, assume that there is a prime p with \(p\mid a\), \(p\mid b\). Then, as \(n_0=0\) and \(n_1=1\) in both cases, (19) with \(i=0,1\) implies that \(p^4\mid x_0^4,x_1^4\), and then \(p^4\mid a,b\). Hence we can cancel \(p^4\) from a and b, since a term of the arithmetic progression \((a/p^4)x+(b/p^4)\) obtained is a fourth power if and only if the corresponding term of the original progression \(ax+b\) was a fourth power itself. So we can gradually get rid of all the common prime factors of ab. Hence we may assume that \(\gcd (a,b)=1\) indeed. Assume now that \(x_0,x_1,x_2\) in (19) are not pairwise coprime. Certainly, \(\gcd (x_0,x_1)=1\), since otherwise (as \(n_0=0\), \(n_1=1\)) by (19) we obtain \(\gcd (a,b)> 1\), which is excluded. So assume that \(\gcd (x_j,x_2)>1\) where \(j=0,1\). Let p be a prime with \(p\mid x_j,x_2\). Then, certainly \(p^4\mid x_j^4,x_2^4\), and (19) with \(i=j,2\) easily gives

$$\begin{aligned} p^4\mid (2-j)a,\ (2-j)b. \end{aligned}$$

However, then of course \(p\mid a,b\), which is excluded. Consequently, we may assume without loss of generality that \(\gcd (a,b)=1\) and \(x_0,x_1,x_2\) are pairwise coprime, indeed.

If \((n_0,n_1,n_2)=(0,1,3)\) then from (19) we get

$$\begin{aligned} 3x_1^4-2x_0^4=x_2^4. \end{aligned}$$

The pairwise coprime integral solutions of the above equation can be parametrized by standard arguments (see e.g. [13], Chap. IV.4). In our case we get

$$\begin{aligned} rx_0^2= & {} -2p^2-2pq+q^2,\\ rx_1^2= & {} 2p^2+q^2,\\ rx_2^2= & {} 2p^2-4pq-q^2, \end{aligned}$$

where \(p,q,r\in {\mathbb Z}\) and \(r\mid 12\). From the second equation we immediately get that \(r>0\). If \(r\in \{1,3,4,12\}\), then the equation

$$\begin{aligned} rx_2^2=2p^2-4pq-q^2=6p^2-(2p+q)^2 \end{aligned}$$

has only the trivial solution \((p,q,x_2)=(0,0,0)\). This follows from that \(6p^2\) cannot be the sum of two squares if \(r=1,4.\) By checking the exponents of 3 in the three terms (and ultimately from that \(u^2\equiv 2v^2\pmod {3}\) is not solvable if \(3\not \mid uv\)) if \(r=3,12\). Further, if \(r=2\) then the equation

$$\begin{aligned} rx_0^2=-2p^2-2pq+q^2=(q-p)^2-3p^2 \end{aligned}$$

has only the trivial solution. (This follows again by checking the exponents of 3 in the three terms.) So we are left with \(r=6\) as the only possibility. In this case multiplying the three equations above, after dividing by \(q^6\) and writing \(x=p\), \(y=36x_0x_1x_2\) we obtain the genus two hyperelliptic curve

$$\begin{aligned} D:\quad y^2=-48x^6 + 48x^5 + 120x^4 + 60x^2 - 12x - 6. \end{aligned}$$

Using Magma [3] we compute generators of its Mordell–Weil group. We get that

$$\begin{aligned} \text{ Jac }(D)(\mathbb {Q})=\langle (x^2 + \frac{1}{2}, 0, 2),(x^2 + x - \frac{1}{2}, 0, 2),(x^2 + x + \frac{1}{4}, 12x + \frac{3}{2}, 2)\rangle , \end{aligned}$$

where the first two elements are of order two and the last one generates the free part. Finally, using the Magma function \(\texttt {Chabauty}\) we obtain that

$$\begin{aligned} D(\mathbb {Q})=\left\{ \left( -\frac{1}{2},\pm \frac{9}{2}\right) \right\} . \end{aligned}$$

This gives rise to the trivial solution with \((x_0^4,x_1^4,x_2^4)=(1,1,1)\). The case with \((n_0,n_1,n_2)=(0,1,4)\) can be excluded in a similar way, so we omit the details. Thus the proof of the theorem is complete. \(\square \)