1 Introduction

A classical result of Erdős and Selfridge [11] says that the product of consecutive positive integers is never a perfect power, that is, the equation

$$\begin{aligned} x(x+1)\cdots (x+k-1)=y^n \end{aligned}$$
(1)

has no solutions in positive integers xkyn with \(k\ge 2\) and \(n\ge 2\). This result and also Eq. (1) has been generalized into various directions. Here we only mention those directions and results which are important from our viewpoint.

The first extension of the problem we mention is when on the left hand side of (1), we omit a term from the product, that is, we consider the equation

$$\begin{aligned} x(x+1)\cdots (x+j-1)(x+j+1)\cdots (x+k-1)=y^n \end{aligned}$$

in positive integers xkyn with \(k\ge 2\) and \(n\ge 2\), where \(0\le j\le k-1\). Confirming a conjecture of Erdős and Selfridge, Saradha and Shorey [20, 21] proved that the only solutions of the above equation are given by

$$\begin{aligned} \frac{4!}{3}=2^3,\quad \frac{6!}{5}=12^2,\quad \frac{10!}{7}=720^2. \end{aligned}$$

The second direction of extensions we mention (which probably attracted the most attention) is when instead of products of consecutive integers one takes products of terms of an arithmetic progression. More precisely, one considers the equation

$$\begin{aligned} x(x+d)\cdots (x+(k-1)d)=y^n \end{aligned}$$

in positive integers xdkyn with \(k\ge 2\), \(n\ge 2\) with \(\gcd (x,d)=1\). Under certain (mild, necessary) conditions Darmon and Granville [9] proved that for fixed k and n, this equation has only finitely many solutions in xdy. (See also Győry, Hajdu and Saradha [14] for a further generalization.) Recently, Bennett and Siksek [2] proved that if k is large enough, then this equation has only finitely many solutions in xdyn. On the other hand, for small values of k, namely for \(k<35\), a result of Győry, Hajdu and Pintér [13] in accordance with a conjecture of Erdős says that (under certain trivial necessary restrictions) this equation has no solutions at all. We also mention that combining the two directions mentioned above, Saradha and Shorey [22] provided results for equations of the above shape, with one term of the progression missing from the product on the left hand side.

The third direction of extensions we refer to is when in (1) in place of \(y^n\) on the right hand side we take an arbitrary polynomial, that is, we consider the equation

$$\begin{aligned} x(x+1)\cdots (x+k-1)=g(y) \end{aligned}$$

in integers xky, where \(g(y)\in {{\mathbb {Q}}}[y]\). Here we recall a result of Kulkarny and Sury [18] who could completely describe when this equation can have infinitely many solutions in xy, for k fixed. Further, in the particular case where g(y) is of the shape \(ay^n+b\), Yuan [26] could give effective upper bounds for xy, while Bilu et al. [5] could prove an ineffective finiteness theorem for xkyn. We also mention that if \(g(y)=\left( {\begin{array}{c}y\\ n\end{array}}\right) \) then all solutions are completely described by results of Erdős [10] and Győry [12].

In this paper we consider a common generalization of the above approaches. Namely, we study the equation

$$\begin{aligned} x(x+d)\cdots (x+(j-1)d)(x+(j+1)d)\cdots (x+(k-1)d)=g(y) \end{aligned}$$
(2)

in integers xdky with \(d\ne 0\), \(k\ge 3\) and \(0\le j\le k-1\), where \(g(y)\in {{\mathbb {Q}}}[y]\). Note that the choice \(j=0\) (or \(j=k-1\)) gives back the classical case, where we have a full product on the left hand side. We shall prove various finiteness results concerning Eq. (2). First, we completely describe those cases where for fixed k and d, (2) has infinitely many solutions in xy. In the particular case where g(y) is of the form \(g(y)=ay^n+b\), we are able to provide effective upper bounds for the solutions xy, as well. We also prove that the polynomials appearing on the left had side, up to some special (completely described) cases are indecomposable. We mention that there are many results in the literature which are related in the sense that they concern equal values or polynomial values of terms of families of combinatorial polynomials. We cannot survey the extremely huge literature, we only refer to the papers [1, 4, 8, 15,16,17, 24] and the references there.

The structure of the paper is the following. In the next section we provide our main results. We give their proofs in the third section. The main tools we use are the Bilu–Tichy theorem [6] and Baker’s method (through results of Schinzel and Tijdeman [23] and Brindza [7]). However, to make them work we need to combine several arguments of combinatorial nature, as well.

2 Main results

For the smooth formulation of our main results, we introduce the following notation. Let kjd be integers with \(d\ne 0\), \(k\ge 3\) and \(0\le j\le k-1\), and put

$$\begin{aligned} f_{k,j}(x)=x(x+d)\cdots (x+(j-1)d)(x+(j+1)d)\cdots (x+(k-1)d). \end{aligned}$$

Consider the equation

$$\begin{aligned} f_{k,j}(x)=g(y) \end{aligned}$$
(3)

(which is a reformulation of (2)) in integers xy with \(k\ge 3\) and \(0\le j\le k-1\), where \(g(y)\in {{\mathbb {Q}}}[y]\). (Note that for \(k<3\) the equation is trivial or empty.)

Now we can formulate our general theorem. This is ineffective in the sense that it only guarantees the finiteness of the solutions of (3) (apart from the exceptional cases), but it does not give an upper bound for the solutions.

Theorem 2.1

Let \(k\ge 8\) and \(g(y)\in {{\mathbb {Q}}}[y]\) with \(\deg g\ge 2\). Then Eq. (3) has only finitely many integer solutions xy, unless we are in one of the following cases:

  1. (i)

    kj are arbitrary, and \(g(y)=f_{k,j}(h(y))\) with some non-constant \(h(y)\in {{\mathbb {Q}}}[y]\),

  2. (ii)

    k is odd, \(j=0,k-1\) and g(y) is of the form \(g(y)=h_1^*(h(y))\) where \(h(y)\in {{\mathbb {Q}}}[y]\) has at most one root of odd multiplicity,

  3. (iii)

    k is odd, \(j=(k-1)/2\) and g(y) is of the form \(g(y)=h_2^*(h(y))\) where \(h(y)\in {{\mathbb {Q}}}[y]\) has at most one root of odd multiplicity.

Here we have

$$\begin{aligned} h_1^*(y)=\left( y-\frac{d^2}{4}\right) \left( y-\frac{(3d)^2}{4}\right) \dots \left( y-\frac{((k-1)d)^2}{4}\right) \end{aligned}$$

and

$$\begin{aligned} h_2^*(y)=(y-d^2)(y-(2d)^2)\dots \left( y-\left( \frac{(k-1)d}{2}\right) ^2\right) . \end{aligned}$$

Remark

The condition \(\deg g\ge 2\) in the above statement is clearly necessary. Further, it is well-known (see also our Lemma 3.4 later on) that if h(y) fulfils the prescribed property in parts (ii) and (iii), then Eq. (3) can have infinitely many integer solutions.

In the case where g(y) is of the form \(ay^n+b\), we are able to give an effective result, bounding xyn. In particular, note that here also the exponent n is a variable, so in fact this theorem concerns families of polynomials g(y).

Theorem 2.2

Let \(k\ge 8\), \(0\le j\le k-1\) and let \(a,b\in {{\mathbb {Q}}}\) with \(a\ne 0\). Then for all solutions of the equation

$$\begin{aligned} f_{k,j}(x)=ay^n+b \end{aligned}$$
(4)

in integers xyn with \(n\ge 2\) we have \(\max (|x|,|y|,n)<C\), where C is an effectively computable constant depending only on kab. Here we use the convention that for \(|y|\le 1\) we have \(n=2,3\).

Remark

One can easily check that we have

$$\begin{aligned} f_{7,3}(x)=\left( x^3+9dx^2+20d^2x+6d^3\right) ^2-36d^6 \end{aligned}$$

(see also Theorem 2.3). This shows that (4) with \(k=7\), \(j=3\) and \(a=1\), \(b=36d^6\), \(n=2\) hence also (3) with \(k=7\), \(j=3\) and \(g(y)=y^2-36d^6\) have infinitely many integer solutions xy. Thus the assumption \(k\ge 8\) in Theorems 2.1 and 2.2 is necessary.

For the formulation of our last theorem, we need to introduce some new notation. Let K be a field and \(F\in K[x]\). Then

$$\begin{aligned} F(x) = G_1(G_2(x)) \quad (G_1 (x),G_2(x)\in K[x]), \end{aligned}$$

is a decomposition of F over K, which is called non-trivial if

$$\begin{aligned} \deg G_1>1\quad \text {and}\quad \deg G_2>1. \end{aligned}$$

Two decompositions \(F(x)=G_1(G_2(x))\) and \(F(x)=H_1(H_2 (x))\) are called equivalent if there exists a linear polynomial \(\tau (x)\in K[x]\) such that we have \(G_1(x)=H_1(\tau (x))\) and \(H_2(x)= \tau (G_2(x))\). We say that the polynomial F(x) is decomposable over K if it has at least one nontrivial decomposition over K – otherwise F(x) is called indecomposable.

Our last theorem shows that up to some special cases, the polynomials \(f_{k,j}(x)\) are indecomposable. This property (similarly e.g. to the papers [1, 8]) plays an important role in the proof of our ineffective statement – however, we also find it of independent interest. Note that the cases with \(j=0,k-1\) could be derived from Theorem 4.3 of [8].

Theorem 2.3

For any \(k\ge 2\) and \(0\le j\le k-1\) the polynomial \(f_{k,j}(x)\) is indecomposable over \({{\mathbb {Q}}}\), except for the following cases:

  1. (i)

    if \(k=7\), \(j=3\) then we have a decomposition of the form \(f_{k,j}(x)=(x^3+9dx^2+20d^2x+6d^3)^2-36d^6\),

  2. (ii)

    if k is odd and \(j=0\) then all non-trivial decompositions of \(f_{k,j}(x)\) are equivalent to \(f_{k,j}(x)=h_1^*\left( \left( x+\frac{(k+1)d}{2}\right) ^2\right) \),

  3. (iii)

    if k is odd and \(j=(k-1)/2\) then all non-trivial decompositions of \(f_{k,j}(x)\) not equivalent to the one in (i) for \((k,j)=(7,3)\), are equivalent to \(f_{k,j}(x)=h_2^*\left( \left( x+\frac{(k+1)d}{2}\right) ^2\right) \),

  4. (iv)

    if k is odd and \(j=k-1\) then all non-trivial decompositions of \(f_{k,j}(x)\) are equivalent to \(f_{k,j}(x)=h_1^*\left( \left( x+\frac{(k-1)d}{2}\right) ^2\right) \).

Here, \(h_1^*\) and \(h_2^*\) are given in Theorem  2.1.

3 Proofs

In this section we give the proofs of our theorems. In this, we follow a reverse order: we start with the proof of Theorem 2.3, then we follow with the proof of Theorem 2.2, and we conclude with the proof of Theorem 2.1. The reason is that as we shall see, this is the ‘logical’ way to follow.

In our arguments we shall need several lemmas. The first two consider certain properties of the derivatives and shifts of the polynomials \(f_{k,j}(x)\). In fact, we can simplify our treatment due to the observation that in these studies the parameter d does not play an important role. That is, instead of the polynomials \(f_{k,j}(x)\) it is sufficient to study the polynomials

$$\begin{aligned} p_{k,j}(x)=x(x+1)\cdots (x+j-1)(x+j+1)\cdots (x+k-1). \end{aligned}$$

The reason why this simplification is possible is that we have

$$\begin{aligned} f_{k,j}(x)=d^{k-1}p_{k,j}(x/d). \end{aligned}$$
(5)

We start with describing the root structure of the polynomials \(p_{k,j}'(x)\) (which is in fact rather simple).

Lemma 3.1

For every \(k\ge 3\) and \(0\le j\le k-1\), the roots of the polynomial \(p_{k,j}'(x)\) are real and simple, and there is a root in each interval

$$\begin{aligned}&(-\,k+1,-k+2),(-\,k+2,-k+3),\ldots ,\\&\dots ,(-\,j-2,-j-1),(-\,j-1,-j+1),(-\,j+1,-j+2),\ldots ,(-\,1,0). \end{aligned}$$

Proof

The statement is a trivial consequence of Rolle’s theorem. Note that the cases \(j=0,k-1\) are already treated in the proof of Proposition 3.4 of [4]. \(\square \)

Our next lemma concerns the common roots of the derivatives and shifts of the polynomials \(p_{k,j}(x)\).

Lemma 3.2

For any \(k\ge 3\) and \(0\le j\le k-1\) we have

$$\begin{aligned} \max _{\lambda \in {{\mathbb {C}}}}\deg \gcd (p_{k,j}'(x),p_{k,j}(x)-\lambda )\le 4. \end{aligned}$$

Proof

If \(k \le 5\) then \(\deg p_{k,j}'(x)\le 4\) and the statement is trivial. So we may assume that \(k\ge 6\). Further, for \(j=0,k-1\) the statement immediately follows from Proposition 3.4 of [4]. Thus we may also assume that \(0<j<k-1\). In what follows, we shall use these assumptions without any further mentioning. Write \(\alpha _1,\ldots ,\alpha _{k-2}\) for the roots of \(p_{k,j}'(x)\). By Lemma 3.1 we know that these roots are distinct, and (renumbering them if necessary) we have

$$\begin{aligned}&-k+1<\alpha _1<-k+2<\cdots<-j-2<\alpha _{k-j-2}<-j-1\\&\quad<\alpha _{k-j-1}<-j+1<\alpha _{k-j}<-j+2<\cdots<-1<\alpha _{k-2}<0. \end{aligned}$$

We give an upper bound for the number of \(\alpha _i\)-s satisfying

$$\begin{aligned} p_{k,j}(\alpha _i)=\lambda \end{aligned}$$

for any fixed \(\lambda \in {{\mathbb {C}}}\). For this, put

$$\begin{aligned} P_{k,j}^*(x):=|p_{k,j}(x)|-|p_{k,j}(x-1)|. \end{aligned}$$

We would like to calculate the sign changes of \(P_{k,j}^*(x)\) inside certain intervals. We note that we take the polynomial \(p_{k,j}\) at x and \(x-1\) (not at other shifts of x) to make this analysis simple - in this way the problem reduces to the study of a quadratic polynomial. Indeed, as we have

$$\begin{aligned}&P_{k,j}^*(x)=(|(x+j-1)(x+k-1)|-|(x-1)(x+j)|)\\&\quad \cdot |x(x+1)\dots (x+j-3)(x+j-2)(x+j+1)(x+j+2)\\&\quad \dots (x+k-3)(x+k-2)|, \end{aligned}$$

we may restrict our attention to

$$\begin{aligned} P_{k,j}(x):=|(x+j-1)(x+k-1)|-|(x-1)(x+j)|. \end{aligned}$$

We need to understand the behavior of \(P_{k,j}(x)\) (and ultimately of \(P_{k,j}^*(x)\)) on certain subintervals of \((-\,k+1,0)\). A simple consideration gives that for \(-k+1<x<0\) we have

$$\begin{aligned} P_{k,j}(x)= {\left\{ \begin{array}{ll} q_1(x),&{}\quad \text {if}\ -j+1<x<0,\\ q_2(x),&{}\quad \text {if}\ -j<x<-j+1,\\ -q_1(x),&{}\quad \text {if}\ -k+1<x<-j, \end{array}\right. } \end{aligned}$$

where

$$\begin{aligned}&q_1(x)=2x^2+(k+2j-3)x+(jk-k-2j+1),\quad \\&q_2(x)=(1-k)x+(k-jk-1). \end{aligned}$$

This shows that \(P_{k,j}(x)\), and hence \(P_{k,j}^*(x)\) changes sign on the interval \((-\,k+1,0)\) at most three times: at the two roots of \(q_1(x)\) and between \(-j\) and \(-j+1\). (Note that the root of \(q_2(x)\) is between \(-j\) and \(-j+1\).) The relevance of this fact is shown by the following observation. Suppose that \(P_{k,j}^*(x)\) is positive on some interval \((-\,i,-i+1)\), with \(0<i\le k-2\). If \(i\ge j\), then \(\alpha _{k-i}\in (-\,i,-i+1)\) and \(\alpha _{k-i-1}\in (-\,i-1,-i)\), and we have

$$\begin{aligned} 0<|p_{k,j}(\alpha _{k-i-1}+1)|-|p_{k,j}(\alpha _{k-i-1})|\le |p_{k,j}(\alpha _{k-i})|-|p_{k,j}(\alpha _{k-i-1})|, \end{aligned}$$

that is,

$$\begin{aligned} |p_{k,j}(\alpha _{k-i})|>|p_{k,j}(\alpha _{k-i-1})|. \end{aligned}$$

A similar phenomenon occurs for \(i<j\), while in the case where \(P_{k,j}^*(x)\) is negative on some interval \((-\,i,-i+1)\), the above relation just turns around. Altogether, we see that the sequence

$$\begin{aligned} |p_{k,j}(\alpha _1)|,|p_{k,j}(\alpha _2)|,\ldots ,|p_{k,j}(\alpha _{k-2})| \end{aligned}$$

changes strict monotonicity at most three times. In other words, the above sequence is the union of at most four strictly monotone sequences, hence it can contain at most four equal terms. This proves our claim. \(\square \)

Now we can give the proof of Theorem 2.3.

Proof of Theorem 2.3

We may clearly assume that \(\deg f_{k,j}\ge 4\), that is, \(k\ge 5\). Observe that in view of (5), it is sufficient to deal with the polynomials \(p_{k,j}\) instead of \(f_{k,j}\). So suppose that \(p_{k,j}(x)\) has a non-trivial decomposition of the form \(p_{k,j}(x)=G(H(x))\) with \(G,H\in {{\mathbb {Q}}}[x]\). It is well-known (see e.g. the proof of Theorem 4.3 of [8]) that then we have

$$\begin{aligned} \deg H \le \max _{\lambda \in {{\mathbb {C}}}} \deg \gcd (p_{k,j}'(x),p_{k,j}(x)-\lambda ). \end{aligned}$$

Thus, by Lemma 3.2, we obtain that \(\deg H \le 4\). Let \(\gamma _1,\ldots ,\gamma _t\) be the (complex) roots of G. They are all simple, because \(p_{k,j}(x)\) has only simple roots. Hence, assuming without loss of generality that G and H are monic, we have

$$\begin{aligned} p_{k,j}(x)=(H(x)-\gamma _1)\cdots (H(x)-\gamma _t). \end{aligned}$$

We consider the cases \(\deg H=2,3,4\) separately.

Let first \(\deg H=2\). Then necessarily \(k-1=\deg p_{k,j}\) is even; put \(k-1=2t\). Further, we have

$$\begin{aligned} H(x)-\gamma _r=(x+a_{2r-1})(x+a_{2r})\quad (r=1,\ldots ,t), \end{aligned}$$

where \(a_1,\ldots ,a_{2t}\) is a permutation of \(0,1,\ldots ,j-1,j+1,\ldots ,k-1\). Writing \(b_1\) for the coefficient of x in H(x),

$$\begin{aligned} a_{2r-1}+a_{2r}=b_1\quad (r=1,\ldots ,t) \end{aligned}$$

follows. By summing up these identities we obtain

$$\begin{aligned} tb_1= \frac{k(k-1)}{2}-j. \end{aligned}$$

As \(t=(k-1)/2\), this yields that \((k-1)/2\) divides j. Since \(0\le j \le k-1\), we get \(j=0,(k-1)/2,k-1\).

If \(j=0\) then \(b_1=k\) and (after re-ordering if necessary) we get

$$\begin{aligned} (a_1,a_2)=(1,k-1),\ldots ,(a_{2t-1},a_{2t})=\left( \frac{k-1}{2},\frac{k+1}{2}\right) . \end{aligned}$$

This gives the decomposition

$$\begin{aligned} p_{k,0}(x)=h_1\left( \left( x+\frac{k+1}{2}\right) ^2\right) \end{aligned}$$

with

$$\begin{aligned} h_1(x)=\left( x-\frac{1}{4}\right) \left( x-\frac{9}{4}\right) \dots \left( x-\frac{(k-1)^2}{4}\right) . \end{aligned}$$

We claim that any other decomposition of \(p_{k,0}(x)\) with \(\deg H=2\) is equivalent to the above one. For this, suppose that we have a decomposition

$$\begin{aligned} p_{k,0}(x)=G_0(H_0(x)) \end{aligned}$$

over \({{\mathbb {Q}}}\) with \(\deg H_0=2\). Write \(H_0(x)=\alpha (x-\beta )^2+\gamma \) with \(\alpha ,\beta ,\gamma \in {{\mathbb {Q}}}\). Then the above decomposition is equivalent to \(P((x-\beta )^2)\) with some polynomial P having rational coefficients. However, this shows that the roots of \(p_{k,0}\) are symmetric with respect to \(\beta \), so \(\beta =(k+1)/2\). This proves our claim, and by (5) we easily get the corresponding decomposition of \(f_{k,0}(x)\).

If \(j=k-1\) then \(b_1=k-2\), and a similar argument shows that we have

$$\begin{aligned} p_{k,k-1}(x)=h_1\left( \left( x+\frac{k-1}{2}\right) ^2\right) , \end{aligned}$$

and up to equivalence, this is the only decomposition of \(p_{k,k-1}(x)\) with \(\deg H=2\). Also, we get the corresponding decomposition of \(f_{k,k-1}(x)\). Note that these cases are handled by Lemma 4.3 of [8], but for the sake of completeness, we wanted to present a full argument.

Finally, if \(j=(k-1)/2\) then we have \(b_1=k-1\), and (after re-ordering if necessary) we obtain

$$\begin{aligned} (a_1,a_2)=(0,k-1),\ldots ,(a_{2t-1},a_{2t})=\left( \frac{k-3}{2},\frac{k+1}{2}\right) . \end{aligned}$$

In this case we have

$$\begin{aligned} p_{k,(k-1)/2}(x)=h_2\left( \left( x+\frac{k+1}{2}\right) ^2\right) \end{aligned}$$

with

$$\begin{aligned} h_2(x)=(x-1^2)(x-2^2)\dots \left( x-\left( \frac{k-1}{2}\right) ^2\right) . \end{aligned}$$

The fact that any decomposition of \(p_{k,(k-1)/2}(x)\) with \(\deg H=2\) is equivalent to this follows by a simple argument as in case of \(j=0\). From these, the description of the decomposition of \(f_{k,(k-1)/2}(x)\) easily follows.

Let now \(\deg H=3\). Then necessarily \(3\mid k-1\); put \(k-1=3t\). Further, we have

$$\begin{aligned} H(x)-\gamma _r=(x+a_{3r-2})(x+a_{3r-1})(x+a_{3r})\quad (r=1,\ldots ,t), \end{aligned}$$
(6)

where \(a_1,a_2,\ldots ,a_{3t}\) is a permutation of \(0,1,\ldots ,j-1,j+1,\ldots ,k-1\). Similarly as in case of \(\deg H=2\), we have

$$\begin{aligned} a_{3r-2}+a_{3r-1}+a_{3r}=b_1\quad (r=1,\ldots ,t), \end{aligned}$$

where \(b_1\) is the coefficient of x in H(x). Adding up the above identities, we obtain \(tb_1=k(k-1)/2-j\), so

$$\begin{aligned} b_1=\frac{3k}{2}-\frac{3j}{k-1}\in {{\mathbb {Z}}}. \end{aligned}$$

Observe that for any \(0\le j\le k-1\) the polynomials \(p_{k,j}(x)\) and \(p_{k,k-1-j}(x)\) can be obtained from each other by a linear transformation. Hence, without loss of generality we may assume that \(j\ge (k-1)/2\). Thus, we obtain that only the following possibilities may occur: k is even and

$$\begin{aligned} (j,b_1)=\left( \frac{2k-2}{3},\frac{3k-4}{2}\right) ,\left( k-1,\frac{3k-6}{2}\right) , \end{aligned}$$

or k is odd and

$$\begin{aligned} (j,b_1)=\left( \frac{k-1}{2},\frac{3k-3}{2}\right) ,\left( \frac{5k-5}{6},\frac{3k-5}{2}\right) . \end{aligned}$$

To handle these cases, we need to go deeper. For this, observe that (6) yields that the elementary symmetric polynomials of any triple \(a_{3r-2},a_{3r-1},a_{3r}\), except for their products, coincide. This implies that for any r with \(1\le r\le t\) we have

$$\begin{aligned} a_1+a_2+a_3=a_{3r-2}+a_{3r-1}+a_{3r}\quad \text {and}\quad a_1^2+a_2^2+a_3^2=a_{3r-2}^2+a_{3r-1}^2+a_{3r}^2. \end{aligned}$$

Since \(j>0\), one of the \(a_i\)-s is zero. Without loss of generality we may assume that \(a_1=0\). Then we get

$$\begin{aligned} b_2:=a_2^2+a_3^2=\frac{\frac{(k-1)k(2k-1)}{6}-j^2}{t}=\frac{k(2k-1)}{2}-\frac{3j^2}{k-1}. \end{aligned}$$

Further, now we also have

$$\begin{aligned} a_2+a_3=b_1. \end{aligned}$$

Thus \(a_2\) and \(a_3\) are roots of the polynomial

$$\begin{aligned} F(x)=x^2-b_1x+\frac{b_1^2-b_2}{2}. \end{aligned}$$

Now in view of the possible pairs \((j,b_1)\), we obtain that F(x) is one of

$$\begin{aligned}&x^2+\frac{4-3k}{2}x+\frac{15k^2-50k+32}{24},\quad x^2+\frac{6-3k}{2}x+\frac{5k^2-22k+24}{8}, \\&x^2+\frac{3-3k}{2}x+\frac{5k^2-13k+6}{8},\quad x^2+\frac{5-3k}{2}x+\frac{15k^2-59k+50}{24}. \end{aligned}$$

A simple calculation shows that these polynomials have real roots only for \(k<9\), so we may restrict to these cases. Recall that \(3\mid k-1\), so we have \(k=4,7\). If \(k=4\), then in a decomposition \(p_{k,j}(x)=G(H(x))\) with \(\deg H=3\) we have \(\deg G=1\), which is a trivial decomposition. So we are left with the only possibility \(k=7\). Here we easily get that the only case which gives rise to a decomposition is \(j=3\) and \((a_1,a_2,a_3)=(0,4,5)\), \((a_4,a_5,a_6)=(1,2,6)\). Then we get the decomposition

$$\begin{aligned} p_{7,3}(x)=(x^3+9x^2+20x+6)^2-36. \end{aligned}$$

From the argument it is clear that any other decomposition of \(p_{7,3}(x)\) of the form G(H(x)) with \(\deg H=3\) is equivalent to the above one. This immediately yields the corresponding decomposability of \(f_{7,3}(x)\).

Finally, let \(\deg H=4\). Then we see that \(4\mid k-1\); let \(k-1=4t\). Further, now we have

$$\begin{aligned} H(x)-\gamma _r=(x+a_{4r-3})(x+a_{4r-2})(x+a_{4r-1})(x+a_{4r})\quad (r=1,\ldots ,t), \end{aligned}$$
(7)

where \(a_1,a_2,\ldots ,a_{4t}\) is a permutation of \(0,1,\ldots ,j-1,j+1,\ldots ,k-1\). Writing \(b_1\) for the coefficient of x in H(x) again, we get

$$\begin{aligned} a_{4r-3}+a_{4r-2}+a_{4r-1}+a_{4r}=b_1\quad (r=1,\ldots ,t). \end{aligned}$$

Adding up the above equalities, we conclude that

$$\begin{aligned} b_1=2k-\frac{4j}{k-1}\in {{\mathbb {Z}}}. \end{aligned}$$

In particular, \(k-1\mid 4j\). Further, similarly as in case of \(\deg H=3\), we may assume that \(j\ge (k-1)/2\). Thus we are left with the following possibilities:

$$\begin{aligned} (j,b_1)=\left( \frac{k-1}{2},2k-2\right) ,\left( \frac{3k-3}{4},2k-3\right) ,(k-1,2k-4). \end{aligned}$$

To handle these cases, observe that since all the elementary symmetric polynomials of the quadruples \(a_{4r-3},a_{4r-2},a_{4r-1},a_{4r}\,(1\le r\le t)\) coincide except for their product, for any \(\ell =1,2,3\) and \(1\le r\le t\) we have

$$\begin{aligned} b_\ell :=a_1^\ell +a_2^\ell +a_3^\ell +a_4^\ell =a_{4r-3}^\ell +a_{4r-2}^\ell +a_{4r-1}^\ell +a_{4r}^\ell . \end{aligned}$$

Adding up these identities for \(r=1,\ldots ,t\) we obtain

$$\begin{aligned} b_2=\frac{\frac{(k-1)k(2k-1)}{6}-j^2}{t}=\frac{2k(2k-1)}{3}-\frac{4j^2}{k-1} \end{aligned}$$

and

$$\begin{aligned} b_3=\frac{\left( \frac{(k-1)k}{2}\right) ^2-j^3}{t}=(k-1)k^2-\frac{4j^3}{k-1}. \end{aligned}$$

Now we pick the quadruple \(a_{4r-3},a_{4r-2},a_{4r-1},a_{4r}\) containing 0. Without loss of generality we may assume that here \(r=1\) and \(a_1=0\). Then we check the possibilities in turn.

If \((j,b_1)=((k-1)/2,2k-2)\) then we have

$$\begin{aligned} a_2+a_3+a_4= & {} 2k-2, \\ a_2^2+a_3^2+a_4^2= & {} \frac{4k^2-5k+3}{3}, \\ a_2^3+a_3^3+a_4^3= & {} \frac{2k^3-3k^2+2k-1}{2}. \end{aligned}$$

A simple calculation e.g. with Maple shows that this system of equations has no solutions in distinct positive integers \(a_2,a_3,a_4\) for \(k\ge 8\). However, if \(k<8\) then \(4\mid k-1\) gives \(k=5\), when \(p_{k,j}(x)\) cannot have a non-trivial decomposition of the required form. Hence our claim follows in this case.

For \((j,b_1)=((3k-3)/4,2k-3)\) we have

$$\begin{aligned} a_2+a_3+a_4= & {} 2k-3, \\ a_2^2+a_3^2+a_4^2= & {} \frac{16k^2-35k+27}{12}, \\ a_2^3+a_3^3+a_4^3= & {} \frac{16k^3-43k^2+54k-27}{16}. \end{aligned}$$

Now a (Maple) calculation, taking resultants and using symmetry in \(a_2,a_3,a_4\) gives that \(a_2,a_3,a_4\) should be the (distinct positive integer) roots of the polynomial

$$\begin{aligned} 48x^3+(144-96k)x^2+(64k^2-218k+162)x-16k^3+95k^2-168k+81. \end{aligned}$$

This polynomial has its unique local maximum at

$$\begin{aligned} x_1:=\frac{8k-12-\sqrt{26k-18}}{12}, \end{aligned}$$

however, the value of the above polynomial at \(x_1\) is negative for \(k\ge 7\). So \(k\le 6\), and our statement follows similarly as before also in this case.

Finally, if \((j,b_1)=(k-1,2k-4)\) then we have

$$\begin{aligned} a_2+a_3+a_4= & {} 2k-4, \\ a_2^2+a_3^2+a_4^2= & {} \frac{4k^2-14k+12}{3}, \\ a_2^3+a_3^3+a_4^3= & {} k^3-5k^2+8k-4. \end{aligned}$$

A simple (Maple) calculation shows that it is not possible with distinct positive integers \(a_2,a_3,a_4\) for \(k\ge 7\). Hence, the proof of the theorem is complete. \(\square \)

Now we turn to the proof of Theorem 2.2. For this, we need two lemmas (which will be needed later on, as well), together with some new notation. Let \(f(x)\in {{\mathbb {Z}}}[x]\) of degree d and height (i.e, maximum of the absolute values of the coefficients) H, and A be a non-zero integer. Consider the equation

$$\begin{aligned} f(x)=Ay^n, \end{aligned}$$
(8)

in \(x,y,n\in {{\mathbb {Z}}}\) with \(n\ge 2\). Our first lemma is a result of Bérczes, Brindza and Hajdu [3]. Note that the first result of this type is due to Tijdeman [25] and Schinzel and Tijdeman [23].

Lemma 3.3

If f(x) has at least two different roots, then for all solutions xyn of (8) with \(|y|>1\) we have

$$\begin{aligned} n<C_1(A,d,H). \end{aligned}$$

Here \(C_1(A,d,H)\) is an effectively computable constant depending only on Ad and H.

Our second lemma is the main result of Brindza [7]. To its formulation we need some new notation. Let S be a finite set of primes, and let \({{\mathbb {Z}}}_S\) be the set of those rational numbers whose denominators have no prime divisors outside S. By the height h(q) of a rational number q we mean the maximum of the absolute value of its denominator and numerator.

Lemma 3.4

Let \(f(x)\in {{\mathbb {Z}}}[x]\) with

$$\begin{aligned} f(x)=a_0\prod _{i=1}^m(x-\gamma _i)^{r_i}, \end{aligned}$$

where \(a_0\) is the leading coefficient of f, and \(\gamma _1,\ldots ,\gamma _m\) are the distinct complex roots of f(x), with multiplicities \(r_1,\ldots ,r_m\), respectively. Further, fix n with \(n\ge 2\), and set

$$\begin{aligned} t_i=\frac{n}{\gcd (n,r_i)} \qquad (i=1,\ldots ,m). \end{aligned}$$

Suppose that \((t_1,\ldots ,t_m)\) is not a permutation of any of the m-tuples

$$\begin{aligned} (t,1,\ldots , 1)\ (t\ge 1),\quad (2,2,1,\ldots ,1). \end{aligned}$$

Then for any finite set S of primes, the solutions \(x,y\in {{\mathbb {Z}}}_S\) of (8) satisfy

$$\begin{aligned} \max {(h(x),h(y))<C_2(A,n,d,H,S)}, \end{aligned}$$

where \(C_2(A,n,d,H,S)\) is an effectively computable constant depending only on AndHS.

Now we are ready to give the proof of our effective result.

Proof of Theorem 2.2

By Lemma 3.3 it is sufficient to prove that the polynomial \(f_{k,j}(x)-b\) has more than two zeros of multiplicities coprime to n. Suppose to the contrary that

$$\begin{aligned} f_{k,j}(x)-b=p(x)\cdot (q(x))^n \end{aligned}$$
(9)

holds with some \(p(x),q(x)\in {{\mathbb {Q}}}[x]\) and \(\deg p\le 2\). Since by Lemma 3.1 and (5) all the roots of \(f_{k,j}'(x)\) are simple, by taking derivative of (9) we immediately get a contradiction for \(n\ge 3\). That is, we may assume that \(n=2\). Then, by taking derivatives of both sides of the above equation, we obtain

$$\begin{aligned} f_{k,j}'(x)=q(x)(p'(x)q(x)+2p(x)q'(x)). \end{aligned}$$

Let \(\alpha _1,\ldots ,\alpha _{k-2}\) be the roots of \(f'_{k,j}(x)\). Observe that all the roots of q(x) are among them. Further, if \(\alpha _i\) is a root of q(x), then (9) yields

$$\begin{aligned} f_{k,j}(\alpha _i)=b. \end{aligned}$$

However, by Lemma 3.2, in view of (5) we see that the above formula may hold for at most four \(\alpha _i\)-s. That is, we have \(\deg q\le 4\). Hence, we obtain that \(k-1=\deg f_{k,j}(x)\le 10\), so \(k\le 11\). That is, we are left with the cases \(8\le k\le 11\). Now a simple and tedious computation with Maple shows that for these values of k, (9) is not possible for any \(0\le j\le k-1\) and \(b\in {{\mathbb {Q}}}\). We illustrate it by an example. Let \(k=8\), \(j=3\). Then letting \(X=x/d\) and \(B=b/d^7\) we have

$$\begin{aligned} f_{8,3}(x)-b=d^7(X(X+1)(X+2)(X+4)(X+5)(X+6)(X+7)-B). \end{aligned}$$

The discriminant of \(X(X+1)(X+2)(X+4)(X+5)(X+6)(X+7)-B\) (with respect to X) is given by

$$\begin{aligned}&-823543B^6-116938944B^5+40895276544B^4+3554646736896B^3\\&-448755174604800B^2-10577549721600000B+758487711744000000 \end{aligned}$$

which is irreducible over \({{\mathbb {Q}}}\). That is, \(f_{8,3}(x)-b\) has no double roots for any \(b\in {{\mathbb {Q}}}\), which proves our claim in this case. In all the other cases we came to similar conclusions. Hence, the theorem follows. \(\square \)

Finally, we prove Theorem 2.1. For this we shall use a deep result of Bilu and Tichy [6] concerning equations of the type

$$\begin{aligned} f(x)=g(y) \end{aligned}$$
(10)

in integers xy, where fg are polynomials with rational coefficients. To describe this result, we need to introduce some notation.

Let \(\alpha ,\beta ,\delta \) be nonzero rational numbers, \(\mu ,\nu ,q\) be positive integers, and r be a non-negative integer, and let \(v(x)\in {{\mathbb {Q}}}[x]\) be a nonzero polynomial (which may be constant). Then

$$\begin{aligned} D_\mu (x,\delta ):=\sum _{i=0}^{\lfloor \mu /2\rfloor }d_{\mu ,i}x^{\mu -2i}\ \ \ \text {where}\ d_{\mu ,i}=\frac{\mu }{\mu -i} \left( {\begin{array}{c}\mu -i\\ i\end{array}}\right) (-\,\delta )^i \end{aligned}$$

is the \(\mu \)-th Dickson polynomial. Note that every second coefficient of a Dickson polynomial is zero. For (many) other properties of these polynomials we refer to the book [19].

The polynomials \(F,G\in {{\mathbb {Q}}}[x]\) form a standard pair over \({\mathbb {Q}}\), if one of (F(x), G(x)) and (G(x), F(x)) appears in Table 1.

Table 1 Standard pairs

Now we formulate the main result of [6], which will be a key ingredient in the proof of Theorem 2.1.

Lemma 3.5

Let \(f(x),g(x)\in {{\mathbb {Q}}}[x]\) be non-constant polynomials. Then the following two assertions are equivalent.

  1. (i)

    Equation (10) has infinitely many rational solutions xy with a bounded denominator.

  2. (ii)

    We have \(f=\varphi \circ F\circ \lambda \) and \(g=\varphi \circ G\circ \kappa \), where \(\lambda (x),\kappa (x)\in {{\mathbb {Q}}}[x]\) are linear polynomials, \(\varphi (x)\in {{\mathbb {Q}}}[x]\), and F(x), G(x) form a standard pair over \({{\mathbb {Q}}}\) such that the equation \(F(x)=G(y)\) has infinitely many rational solutions xy with a bounded denominator.

Now we give the proof of our ineffective result.

Proof of Theorem 2.1

In case of \(\deg g=2\) the statement easily follows from Theorem 2.2, in an effective form. Hence, in what follows, without loss of generality we may assume that \(\deg g\ge 3\). Suppose that Eq. (3) has infinitely many integer solutions. Then by Lemma 3.5 there exist \(\lambda (x),\kappa (x),\varphi (x)\in {{\mathbb {Q}}}[x]\) with \(\deg \lambda =\deg \kappa =1\) such that

$$\begin{aligned} f_{k,j}(x)=\varphi (F(\lambda (x)))\quad \text {and}\quad g(x)=\varphi (G(\kappa (x))), \end{aligned}$$

where F(x), G(x) form a standard pair over \({{\mathbb {Q}}}\). By Theorem 2.3, we also have that \(\deg \varphi =1,(k-1)/2,k-1\).

If \(\deg \varphi =k-1\), then \(\deg F=1\). Thus \(t(x):=F(\lambda (x))\) is a linear polynomial over \({{\mathbb {Q}}}\). Then clearly, \(t^{-1}(x)\in {{\mathbb {Q}}}[x]\) is also a linear polynomial, and we have \(\varphi (x)=f_{k,j}(t^{-1}(x))\). Hence we just get part (i) of the statement. On the other hand, if g(y) is of the form \(g(y)=f_{k,j}(h(y))\) with a non-constant \(h(y)\in {{\mathbb {Q}}}[y]\), then (3) clearly has infinitely many solutions. Thus, the discussion of this case is complete.

Let now \(\deg {\varphi }=(k-1)/2\); then clearly, k is odd. By Theorem 2.3 we know that then the decomposition \(f_{k,j}(x)=\varphi (F(x))\) is equivalent to one of

$$\begin{aligned} h_1^*\left( \left( x+\frac{(k+1)d}{2}\right) ^2\right) ,\quad h_2^*\left( \left( x+\frac{(k+1)d}{2}\right) ^2\right) ,\quad h_1^*\left( \left( x+\frac{(k-1)d}{2}\right) ^2\right) , \end{aligned}$$

according as \(j=0,(k-1)/2,k-1\), respectively. Thus, Lemma 3.5 shows that if (3) has infinitely many integral solutions, then necessarily the equation \(G(y)=X^2\) has infinitely many solutions with bounded denominator, where X is a linear transformation of one of \(x+(k\pm 1)d/2\). Hence by Lemma 3.4 we obtain parts (ii) and (iii) of the statement.

Finally, suppose that \(\deg \varphi =1\). Recall that we have

$$\begin{aligned} f_{k,j}(x)=\varphi (F(\lambda (x))),\quad g(x) = \varphi (G(\kappa (x))), \end{aligned}$$

where F(x), G(x) form a standard pair. We check the possibilities in turn.

First observe that as \(k\ge 8\) and \(\deg g\ge 3\), F(x), G(x) cannot form a standard pair of the second or fifth type.

If F(x), G(x) form a standard pair of the first type, then we have

$$\begin{aligned} f_{k,j}(x)=u_1(w_1x+w_2)^q+u_2\quad \text {or}\quad f_{k,j}(x)=u_1(w_1x+w_2)^rv(w_1x+w_2)^q+u_2 \end{aligned}$$

with some rational numbers \(u_1,u_2,w_1,w_2\) satisfying \(u_1w_1\ne 0\). As by Lemma 3.1 and (5) the polynomial \(f_{k,j}'(x)\) has no double roots, in either case we have \(q\le 2\). However, then as \(k\ge 8\) and \(\deg g\ge 3\), neither of \(f_{k,j}(x)\) and g(x) can be equivalent to \(x^q\), thus this case cannot occur.

So we are left with the possibilities where F(x), G(x) form a standard pair of the third or fourth kind. Observe that in both cases, in view of (5),

$$\begin{aligned} p_{k,j}(w_1x+w_2)=u_1D_\mu (x,\delta )+u_2 \end{aligned}$$

holds with some positive integer \(\mu \) and \(u_1,u_2,w_1,w_2,\delta \in {{\mathbb {Q}}}\), \(u_1w_1\delta \ne 0\). Observe that here the leading coefficients are \(w_1^{k-1}\) and \(u_1\), respectively. So without loss of generality we may assume that \(w_1=u_1=1\). Further, we clearly have \(\mu =\deg p_{k,j}(x)=k-1\). Hence, letting \(u=u_2\) and \(w=w_2\) we can write

$$\begin{aligned} p_{k,j}(x+w)=D_{k-1}(x,\delta )+u. \end{aligned}$$
(11)

Put

$$\begin{aligned} p_{k,j}(x+w)=s_1x^{k-1}+s_2x^{k-2}+\dots +s_{k-1}x+s_k. \end{aligned}$$

Then, as every second coefficient of the Dickson polynomial is zero, using Maple we get

$$\begin{aligned} s_2&= \frac{1}{2}k^2 + \left( w- \frac{1}{2}\right) k-w-j = 0,\\ s_4&= \frac{1}{48}k^6 + \frac{6w-7}{48}k^5 + \frac{12w^2-38w-6j+17}{48}k^4\\&\quad + \frac{8w^3-72w^2+78w-24jw+20j-17}{48}k^3\\&\quad +\frac{-24w^3+66w^2-29w-12jw^2+48jw+12j^2-9j+3}{24}k^2\\&\quad + \frac{22w^3-18w^2+3w+30jw^2+12j^2w-18jw-6j^2+j}{12}k\\&\quad -(w+j)^3= 0. \end{aligned}$$

Solving this equation system for j by Maple, we get that only the following cases are possible:

$$\begin{aligned} (j,w)=\left( 0,-\frac{k}{2}\right) ,\quad \left( \frac{k-1}{2},\frac{1-k}{2}\right) ,\quad \left( k-1,\frac{2-k}{2}\right) . \end{aligned}$$

Write

$$\begin{aligned} D_{k-1}(x,\delta )+u=t_1x^{k-1}+t_2x^{k-2}+\dots + t_{k-1}x+t_k. \end{aligned}$$

We handle the possible pairs (jw) in turn, by comparing the coefficients of \(x^{k-3}\) and \(x^{k-5}\) in (11). For this, note that as \(k\ge 8\) we have

$$\begin{aligned} t_3=(1-k)\delta ,\quad t_5=\frac{(k-1)(k-4)}{2}\delta ^2. \end{aligned}$$

First take \((j,w)=(0,-k/2),(k-1,(2-k)/2)\). Then a simple Maple calculation gives that in both cases we have

$$\begin{aligned} s_3=\frac{-k^3+3k^2-2k}{24}, \end{aligned}$$

and

$$\begin{aligned} s_5=\frac{5k^6-48k^5+155k^4-180k^3+20k^2+48k}{5760}. \end{aligned}$$

Now the equations \(t_3=s_3\), \(t_5=s_5\) yield \(k\le 4\), which is a contradiction.

Let now \((j,w)=((k-1)/2,(1-k)/2)\). Then we obtain

$$\begin{aligned} s_3=\frac{-k^3+k}{24}, \end{aligned}$$

and

$$\begin{aligned} s_5=\frac{5k^6-18k^5-10k^4+60k^3+5k^2-42k}{5760}. \end{aligned}$$

Now from \(t_3=s_3\), \(t_5=s_5\) we get \(k\le 7\), which is a contradiction again, and the theorem follows. \(\square \)