1 Introduction

The Fibonacci sequence \(\{F_n\}_{n=0}^\infty\) is one of the most popular sequences in mathematics and known all over the world. An interesting observation is shown by the equalities

$$\begin{aligned} F_1= & {} F_2=F_2^2=F_2^3=\dots , \\ F_1+2F_2= & {} F_4, \\ F_1+2F_2+3F_3= & {} F_4^2, \\ F_1+2F_2+3F_3+4F_4= & {} F_8, \end{aligned}$$

where the sums of Fibonacci numbers on the left-hand side are weighted by consecutive positive integers. Thus it is natural to ask: is there any rule for \(F_1+2F_2+3F_3+\cdots +kF_k\)? A more general problem is to solve the diophantine equation

$$\begin{aligned} F_1^p + 2F_2^p + \cdots + \ell F_\ell ^p = F_n^q, \end{aligned}$$
(1)

where the exponents p and q are positive integers.

The main motivation of this paper is to investigate analogous problem to (1) for certain binary recurrences. Equation (1) is not solved completely yet, and a conjecture says that the only additional non-trivial solution is \(F_1^3+2F_2^3+3F_3^3=27=F_4^3\). On the bright side, there exist results what handle particular cases. The first article is due to Németh et al. [4]. They determined, using elementary method based on the number theoretic properties of Fibonacci sequence, the solutions to (1) for the exponents \(p,q\in \{1,2\}\). Then Gueth et al. [2] gave a uniform treatment of (1) independently from p and q, and solved the equation with small exponents. They applied algebraic number theoretical approach, which works for arbitrary p and q in theory. The results of these papers were extended by Altassan and Luca [1], who showed that equation (1) has only finitely many positive integer solutions \((\ell ,p,n,q)\) with \(\ell \ge 3\), and these solutions are bounded by \(\max \{\ell ,p,n,q\}<10^{2500}\). Clearly, this huge bound does not make possible to verify the corresponding cases by computer.

Other binary recurrences were also investigated for the equivalent equation to (1). Tchammou and Togbé [6] solved the cases \(p,q\in \{1,2\}\) for Pell numbers (given by \(P_0=0\), \(P_1=1\), and \(P_m=2P_{m-1}+P_{m-2}\) if \(m\ge 2\)), and for the sequence of balancing numbers [7] (\(B_0=0\), \(B_1=1\), and \(B_m=6B_{m-1}-B_{m-2}\)). Recently, Gueth [3] handled the same problem for the sequence of Lucas numbers (\(L_0=2\), \(L_1=1\), and \(L_m=L_{m-1}+L_{m-2}\)).

The novelty of this work is to examine a family of infinite sequences, namely the so-called k-Fibonacci numbers characterized by the parameter k. For technical reason we carry out the calculations only for \(2\le k\le k_1=10\), but this range could be extended for larger \(k_1\) as we would use more computer capacity. Note that the case \(k=1\) was investigated in [2, 4].

Now we introduce the sequences we will study in this work. Let k be a positive integer, and define the k-Fibonacci sequence \(\{G_m\}_{m=0}^\infty\) as usual: let \(G_0=0\), \(G_1=1\), and

$$\begin{aligned} G_m=kG_{m-1}+G_{m-2}\quad \text {if}\quad m\ge 2. \end{aligned}$$
(2)

Note that the formula \(F_{(k,m)}\) is often used for the mth term of k-Fibonacci sequence, but we find that the notation we introduced is simpler, and makes the text more convenient to read even if it does not indicate the parameter k. This will not be distracting since because throughout the paper, apart from the computational subsection, we always consider general k value. Clearly, the case \(k=1\) returns with the Fibonacci sequence itself, while \(k=2\) defines the Pell sequence. The associate sequence \(\{H_m\}_{m=0}^\infty\) of \(\{G_m\}_{m=0}^\infty\) satisfies the same recurrence rule (\(H_m=kH_{m-1}+H_{m-2}\)), but the initial values now are \(H_0=2\) and \(H_1=k\). We will use later the first few terms of these sequences, therefore we give them here for \(m=0,1,\dots ,5\):

$$\begin{aligned} \begin{array}{llllllll}G_m: &{}\quad 0, &{} \quad 1, &{} \quad k, &{}\quad k^2+1, &{}\quad k^3+2k, &{} \quad k^4+3k^2+1, &{} \quad \dots ,\\ H_m: &{}\quad 2, &{}\quad k, &{}\quad k^2+2, &{}\quad k^3+3k, &{}\quad k^4+4k^2+2, &{}\quad k^5+5k^3+5k, &{}\quad \dots .\\ \end{array} \end{aligned}$$

Note that both sequences are increasing if \(n\ge 1\), moreover \(H_m\) is always even whenever k is even. The common characteristic polynomial \(c(x)=x^2-kx-1\) of \(\{G_m\}\) and \(\{H_m\}\) has two simple real zeros

$$\begin{aligned} \alpha =\frac{k+\sqrt{k^2+4}}{2},\qquad \beta =\frac{k-\sqrt{k^2+4}}{2}. \end{aligned}$$
(3)

Consequently, \(\alpha +\beta =k\), \(\alpha \beta =-1\), furthermore \(\alpha\) is positive with approximate value k, while \(\beta\) is negative. Moreover (3) implies \(\alpha >k\), \(|\beta |<1/k\), and \(\alpha -|\beta |=k\). Put \(D=k^2+4\), which is never a square of an integer, so \({\mathbb {Q}}(\alpha )\) is a quadratic extension of the field of rational numbers. We also have \(\alpha -\beta =\sqrt{D}\). The corresponding Binet forms are

$$\begin{aligned} G_m=\frac{\alpha ^m-\beta ^m}{\sqrt{D}}\quad \textrm{and}\quad H_m=\alpha ^m+\beta ^m. \end{aligned}$$
(4)

In this paper, we deal with the solutions to the exponential diophantine equation

$$\begin{aligned} G_1^p+2G_2^p+\cdots +\ell G_\ell ^p=G_n^q \end{aligned}$$
(5)

in positive integers \(k,\ell ,p,n,q\) if k, p, and q are small. More precisely, we suppose \(1\le p,q\le 10\) and \(2\le k\le 10\) (recall that the case \(k=1\) was examined in [4] and [2]). The upper bound 10 is subjective, and the method, at least in theory, would work with arbitrary positive integers p, q, and k. The solutions

$$\begin{aligned} G_1^p=1=G_1^q \end{aligned}$$

to (5) are considered as trivial ones. Thus in the sequel, we assume that \(\ell \ge 2\). The main statement is recorded in

Theorem 1

If \(2\le k\le 10\) and \(\ell ,p,n,q\) satisfy (5) for some k with the conditions \(1\le p,q\le 10\), \(\ell \ge 2\), then

$$\begin{aligned} k=2,\quad \ell =2, \quad p=1,\quad n=3,\quad q=1. \end{aligned}$$

Most arguments on exponential diophantine equations apply some linear forms in logarithms of algebraic number, see for an example [1] from our list of references. But here we prefer elementary method combined with algebraic number theory because it works trimly, and in the light of [1] and [2] it seems to be simpler. In the proof, we essentially follow the strategy of [2], but at some stages we need to modify that. First, owning to the fact that we have a plus parameter k (appears in the definition of the sequence \(\{G_m\}\)) the bounds become more complicated. Secondly, the case when the absolute value on the left-hand side of (14) vanishes is more difficult because the discriminant \(D=k^2+4\) belonging to the Fibonacci sequence is \(D=5\), a prime number, but \(k^2+4\) is not prime whenever \(k\ge 2\). Finally, the verification of the small cases of \(\ell\) requires a refinement of the algorithm we used in [2].

The paper is organized as follows. In Sect. 2, we collect some properties of k-Fibonacci numbers we will need later in the proof of Theorem 1. These properties are presented in four lemmata. Then in Sect. 3, we prove Theorem 1. This section is split into three main parts. The first one is devoted to approximate both sides of equation (5) by eliminating the dominant terms and giving upper bound on the error terms. The second subsection describes a method to gain upper bound on \(\ell\) assuming that p, q, and k are fixed. The bound does not exceed \(10^3\) in each cases, and this small upper bound allows us to check the solutions to (5) by computer in the third subsection. Finally, Sect. 4 handles a particular problem arose earlier in the second part of Sect. 3. We separated this problem from Sect. 3 since the treatment relies on several modular features of \(G_n\) and \(H_n\), and it is rather long and more and less technical.

2 Preliminaries

In this section, we collect some preliminary results we will use in the proof of the theorem. The following two lemmata are know specially for the Fibonacci and Lucas numbers (i.e. when \(k=1\)), but now we present the statements for arbitrary k.

Lemma 2

For \(m\in \mathbb {N^+}\) we have

$$\begin{aligned} \alpha ^{m-2}\le G_m\le \alpha ^{m-1}\quad \textrm{and}\quad \alpha ^{m-1}\le H_m. \end{aligned}$$

The first inequality is sharp unless \(k=1\) and \(m=2\), the second inequality is so if \(m\ne 1\), and the last one is sharp unless \(k=1\) and \(m=1\).

Proof

The bounds on \(G_m\) can be proved by induction, the details are left to the reader. The corresponding explicit formula in (4) and some straightforward manipulations lead easily to the third inequality. Indeed, we have

$$\begin{aligned} 1\le k=\alpha -|\beta |\le \alpha -|\beta |\left( \frac{|\beta |}{\alpha }\right) ^{m-1}\le \alpha +\beta \left( \frac{\beta }{\alpha }\right) ^{m-1}, \end{aligned}$$

and this implies the statement after multiplying the two sides by \(\alpha ^{m-1}\). \(\square\)

Lemma 2 yields immediately

Corollary 3

If \(k\ge 2\), then \(\alpha ^{m-2}< G_m\le \alpha ^{m-1}\) and \(\alpha ^{m-1}< H_m\) hold. For \(m\ge 2\) we have \(G_m< \alpha ^{m-1}\).

Lemma 4

The inequality \(G_{m+1}/G_m> k\) holds for \(m \ge 2\). For \(m=1\) we have \(G_{m+1}/G_m= k\).

Proof

Definition (2) implies \(G_{m+1}=kG_m+G_{m-1}\ge kG_m\), which leads immediately to the lemma. \(\square\)

It follows from successive applications of Lemma 4 that

$$\begin{aligned} \frac{G_{l-i}}{G_l} \le \left( \frac{1}{k}\right) ^i \end{aligned}$$
(6)

if \(l \ge 2\) and \(l \ge i \ge 0\).

Lemma 5

If \(\ell \ge 2,p,n\), and q satisfy (5) for some positive integer \(k\ge 2\), then

$$\begin{aligned} (n-2)q < \log _{\alpha } \frac{\ell k}{k-1} + (\ell -1)p, \end{aligned}$$

and

$$\begin{aligned} \log _{\alpha } \ell + (\ell -2)p < (n-1)q \end{aligned}$$

hold.

Proof

By Corollary 3 and inequality (6) we have

$$\begin{aligned} \alpha ^{(n-2)q}< G_n^q= & {} G_1^p+2G_2^p+\cdots +\ell G_\ell ^p \\= & {} \ell G_\ell ^p \left( \frac{1}{\ell } \left( \frac{G_1}{G_{\ell }}\right) ^p + \frac{2}{\ell } \left( \frac{G_2}{G_{\ell }}\right) ^p + \cdots + \frac{\ell -1}{\ell }\left( \frac{G_{\ell -1}}{G_\ell }\right) +1 \right) \\< & {} \ell G_\ell ^p \left( \left( \frac{1}{k}\right) ^{(\ell -1)p} + \left( \frac{1}{k}\right) ^{(\ell -2)p} + \cdots + \left( \frac{1}{k}\right) ^p + 1 \right) \\< & {} \ell G_\ell ^p \sum _{j=0}^\infty \left( \frac{1}{k}\right) ^{jp} = \ell G_\ell ^p \frac{1}{1-\left( \frac{1}{k}\right) ^p} \;\le \; \ell \frac{k}{k-1} \alpha ^{(\ell -1)p}. \end{aligned}$$

Taking logarithm of both sides we arrive at the first statement of the lemma.

The second statement follows directly from

$$\begin{aligned} \ell \alpha ^{(\ell -2)p}< \ell G_\ell ^p < G_n^q \le \alpha ^{(n-1)q}. \end{aligned}$$

\(\square\)

The last result of this section is due to Sanna [5, Corollary 1.7]. Assume that p is a prime number. Let \(\nu _p(u_m)\) stand for the p-adic valuation of the terms of the Lucas sequence \(\{u_m\}\) (i.e. \(u_0=0\), \(u_1=1\), and \(u_m=au_{m-1}+bu_{m-2}\) for some fixed coprime integers a and b). Let \(\Delta\) denote the non-zero discriminant of the characteristic polynomial \(x^2-ax-b\). Moreover let \(\tau (p)\) denote the least positive integer such that \(p\mid u_{\tau (p)}\). (The existence of \(\tau (p)\) is known.)

Lemma 6

If \(p\ge 5\) is a prime number such that \(p\not \mid b\), then

$$\begin{aligned} \nu _p(u_m)= {\left\{ \begin{array}{ll} \nu _p(m),&{} \textrm{if}\; p\mid \Delta , \\ \nu _p(m)+\nu _p(u_{\tau (p)}),&{} \textrm{if}\; p\not \mid \Delta ,\, \tau (p)\mid m, \\ 0 &{} \textrm{if}\; p\not \mid \Delta ,\, \tau (p)\not \mid m \end{array}\right. } \end{aligned}$$

holds for every positive integer n.

3 Proof of the theorem

The proof is presented in three parts such that a particular case remains to Sect. 4. Recall that \(k\ge 2\). We remark that only the computational part will use the restriction \(p,q,k\le 10\).

3.1 Preparation

First we approximate both sides of equation (5) by eliminating the dominant terms and giving upper bound on the error terms. For arbitrary \(j\ge 1\) the binomial theorem admits

$$\begin{aligned} G_j^p= \left( \frac{\alpha ^j - \beta ^j}{\sqrt{D}} \right) ^p = \frac{1}{D^{p/2}}\alpha ^{jp}+\frac{1}{D^{p/2}} \sum _{i=1}^p(-1)^i\left( {\begin{array}{c}p\\ i\end{array}}\right) \alpha ^{j(p-i)}\beta ^{ji}. \end{aligned}$$

Put

$$\begin{aligned} \rho _{p,j}=G_j^p - \frac{\alpha ^{jp}}{D^{p/2}}=\frac{1}{D^{p/2}}\sum _{i=1}^p(-1)^i\left( {\begin{array}{c}p\\ i\end{array}}\right) \alpha ^{j(p-i)}\beta ^{ji}. \end{aligned}$$

Since

$$\begin{aligned} D^{p/2}|\rho _{p,j} |<\alpha ^{j(p-1)}\sum _{i=1}^p\left( {\begin{array}{c}p\\ i\end{array}}\right) <\alpha ^{j(p-1)}2^p \end{aligned}$$

it follows that

$$\begin{aligned} |\rho _{p, j} |\le \left( \frac{2}{D^{1/2}}\right) ^p \alpha ^{j(p-1)} = \left( \frac{2}{\sqrt{k^2+4}}\right) ^p \alpha ^{j(p-1)} < \left( \frac{3}{4}\right) ^p \alpha ^{j(p-1)}. \end{aligned}$$
(7)

We used that if \(k \ge 2\), then \(2/\sqrt{k^2 + 4} \le 2/\sqrt{8} < 3/4\), which is a comfortable number as upper bound. Now we rewrite the left-hand side of (5) as

$$\begin{aligned} \sum _{j=1}^\ell j G_j^p = \frac{1}{D^{p/2}} \sum _{j=1}^l j \alpha ^{jp} + \sum _{j=1}^l j \rho _{p,j} = \frac{1}{D^{p/2}} \sum _{j=1}^l j \alpha ^{jp} + R_1, \end{aligned}$$

where

$$\begin{aligned} |R_1 |\le \sum _{j=1}^\ell j |\rho _{p,j}|< \ell ^2 \left( \frac{3}{4}\right) ^p \alpha ^{\ell (p-1)}. \end{aligned}$$

Apply now the identity

$$\begin{aligned} \sum _{j=1}^{\ell } j x^j = \frac{\ell x^{\ell +2}- (\ell +1) x^{\ell +1} + x}{(x-1)^2} \end{aligned}$$

(see, for instance [2]) for \(\sum _{j=1}^l j \alpha ^{jp}\) by substituting \(x = \alpha ^p\). It leads to

$$\begin{aligned} \sum _{j=1}^\ell j G_j^p= & {} \frac{1}{D^{p/2}} \frac{\ell \alpha ^{p(\ell +2)}- (\ell +1) \alpha ^{p(\ell +1)} + \alpha ^p}{(\alpha ^p-1)^2} + R_1 \\= & {} \frac{\ell \alpha ^p - (\ell +1)}{D^{p/2}(\alpha ^p-1)^2 } \alpha ^{p(\ell +1)} + \frac{\alpha ^p }{D^{p/2}(\alpha ^p-1)^2 } + R_1. \end{aligned}$$

Similarly, by an analogue of (7) we can rewrite the right-hand side of (5) to obtain

$$\begin{aligned} G_n^q = \frac{\alpha ^{nq}}{D^{q/2}} + R_2,\quad \text {where}\;\; |R_2 |< \left( \frac{3}{4}\right) ^q \alpha ^{n(q-1)}. \end{aligned}$$

Using the first statement of Lemma 5, and the fact that \(\alpha < \sqrt{k^2 + 4}=\sqrt{D}\) we modify this bound as follows.

$$\begin{aligned} |R_2 |< & {} \left( \frac{3}{4}\right) ^q \alpha ^{n(q-1)} = \left( \frac{3}{4}\right) ^q \alpha ^{(n-2)q+2q-n} \nonumber \\< & {} \left( \frac{3}{4}\right) ^q \frac{\ell k}{k-1} \alpha ^{(\ell -1)p+2q-n} < \left( \frac{3}{4}\right) ^q \frac{k}{k-1} D^q \ell \alpha ^{(\ell -1)p-n}. \end{aligned}$$
(8)

In the next steps, we will replace n by suitable expressions in the exponent of the last term in (8). If \(\ell \le n\), then

$$\begin{aligned} |R_2 |< \left( \frac{3}{4}\right) ^q \frac{k}{k-1} D^q \ell \alpha ^{(\ell -1)p-\ell }. \end{aligned}$$

Suppose now \(\ell > n\), which together with \(G_{\ell }^p < G_n^q\) (comes trivially from equation (5)) implies \(p < q\). If we denote by b the maximum of p and q, then \(b = q \ge 2\) holds now. From the second statement of Lemma 5 we conclude

$$\begin{aligned} n> \frac{\log _{\alpha } \ell + (\ell -2)p}{q} + 1 > \frac{\ell -2}{b} + 1. \end{aligned}$$

Thus recalling (8) we see

$$\begin{aligned} |R_2 |< \left( \frac{3}{4}\right) ^q \frac{k}{k-1} D^q \ell \alpha ^{(\ell -1)p-\frac{\ell -2}{b}-1} < \left( \frac{3}{4}\right) ^q \frac{k}{k-1} D^q \ell \alpha ^{\ell p-\frac{\ell }{b}}, \end{aligned}$$
(9)

which is an upper bound in the case \(\ell \le n\), too. So we can consider it as a general bound on \(|R_2 |\). The upper bound for \(|R_1 |\) can be also varied such that

$$\begin{aligned} |R_1 |< \ell ^2 \left( \frac{3}{4}\right) ^p \alpha ^{\ell p-\frac{\ell }{b}} \end{aligned}$$
(10)

holds.

Put \(\Delta _p = (\alpha ^p-1)^2\). Finally, it is easy to check that if \(k \ge 2\) and \(p \ge 1\), then

$$\begin{aligned} \frac{\alpha ^p}{\Delta _p} =\frac{\alpha ^p}{(\alpha ^p-1)^2} < \alpha \le \alpha ^{\ell p-\frac{\ell }{b}+1}. \end{aligned}$$
(11)

3.2 Bounding \(\ell\)

Returning to equation (5) it has the form

$$\begin{aligned} \frac{\ell \alpha ^p - (\ell +1)}{D^{p/2}\Delta _p } \alpha ^{p(\ell +1)} + \frac{\alpha ^p }{D^{p/2}\Delta _p } + R_1 = \frac{\alpha ^{nq}}{D^{q/2}} + R_2, \end{aligned}$$

which is equivalent with

$$\begin{aligned} \frac{D^{(q-p)/2} (\ell \alpha ^p - (\ell +1))}{\Delta _p } \alpha ^{p(\ell +1)} - \alpha ^{nq} = D^{q/2} \left( R_2 - R_1\right) - \frac{D^{(q-p)/2} \alpha ^p}{\Delta _p}. \end{aligned}$$
(12)

For the moment let us write \(\xi =\xi (p,q,\ell ,n)\) for the left-hand side of (12). Combining the bounds (9), (10), and (11) for the right-hand side of (12) we have the estimate

$$\begin{aligned} \left|\xi \right|< \left( \frac{3}{4}\right) ^q \frac{k}{k-1} D^{3q/2} \ell \alpha ^{\ell p-\frac{\ell }{b}} +D^{q/2} \left( \frac{3}{4}\right) ^p \ell ^2 \alpha ^{\ell p-\frac{\ell }{b}} +D^{(q-p)/2} \alpha ^{\ell p-\frac{\ell }{b} + 1}. \end{aligned}$$

Then

$$\begin{aligned} \frac{\left|\xi \right|}{\alpha ^{p(\ell +1)}} < \frac{\left( \frac{3}{4}\right) ^q \frac{k}{k-1} D^{3q/2} \ell + D^{q/2} \left( \frac{3}{4}\right) ^p \ell ^2 + D^{(q-p)/2} \alpha }{\alpha ^{p+\ell /b}} \end{aligned}$$
(13)

follows. Denote the numerator of the fraction on the right-hand side of (13) by \(z_{p, q, k}(\ell )\). Obviously, it is a quadratic polynomial of \(\ell\), and it also depends on k since \(D=k^2+4\). Let \(\mu = nq - p (\ell +1)\). Thus we can rewrite (13) into the form

$$\begin{aligned} \left|\frac{D^{(q-p)/2} (\ell \alpha ^p - (\ell +1))}{\Delta _p} - \alpha ^{\mu } \right|< \frac{z_{p, q, k}(\ell )}{\alpha ^{p+\frac{\ell }{b}}}. \end{aligned}$$
(14)

In order to deduce a suitable upper bound on \(\alpha ^{p+\frac{\ell }{b}}\) from (14) now we distinguish two cases. Suppose first that

$$\begin{aligned} \alpha ^{\mu } \le \frac{D^{(q-p)/2}}{3 \Delta _p}. \end{aligned}$$
(15)

Under restriction (15) we will show that the expression in the absolute value of the left-hand side of (14) is positive, and we will find a convenient lower bound. Observe that

$$\begin{aligned} \frac{D^{(q-p)/2} }{\Delta _p} (\ell \alpha ^p - (\ell +1)) - \alpha ^{\mu } \ge \frac{D^{(q-p)/2}}{\Delta _p} \left( \ell (\alpha ^p - 1) - 1 - \frac{1}{3}\right) >\frac{D^{(q-p)/2}}{\Delta _p}, \end{aligned}$$

which is a positive number. We applied the inequality \(\ell (\alpha ^p - 1) - 4/3\ge 1\). Clearly, it is true because \(k \ge 2\), \(\ell \ge 2\) and \(p \ge 1\), which provide \(\ell (\alpha ^p - 1) \ge 2(\alpha -1) =k+\sqrt{k^2+4}-2\ge \sqrt{8}> 7/3\). Combining the arguments above with (14) we get

$$\begin{aligned} \alpha ^{\frac{\ell }{b}+p} < \Delta _p D^{(p-q)/2}z_{p, q, k}(\ell ). \end{aligned}$$
(16)

The left-hand side is exponential, the right-hand side is polynomial in \(\ell\) ( while \(\Delta _p D^{(p-q)/2}\) is constant in \(\ell\)), therefore (16) can be valid only if \(\ell\) is small, i.e. if \(\ell \le \ell _0\) (this bound depends on pq and k).

Suppose now that the opposite of (15) holds and the left-hand side of (14) is non-zero. Later, in Sect. 4, we will prove that only one case exists when the left-hand side of (14) vanishes, but the corresponding values do not give solution to (5). Returning again to (14), it is equivalent now to

$$\begin{aligned} \left|(\ell \alpha ^p - (\ell +1)) - \alpha ^{\mu } D^{(p-q)/2} \Delta _p \right|< \frac{D^{(p-q)/2} \Delta _p z_{p, q, k}(\ell )}{\alpha ^{\frac{\ell }{b}+p}}. \end{aligned}$$
(17)

Take the conjugate in \({\mathbb {Q}}(\sqrt{D})\) of the expression in the absolute value in (17) (this means the substitution of \(\alpha\) by \(\beta\), and \(D^{1/2}\) by \(-D^{1/2}\)). Since

$$\begin{aligned} \left|\beta ^{\mu } \right|= \alpha ^{-\mu } < \frac{3 \Delta _p}{D^{(q-p)/2}} = 3 D^{(p-q)/2} \Delta _p, \end{aligned}$$

and we see that if \(k \ge 2\), \(p \ge 1\), then \(\left|\beta -1 \right|\le \left|1-\sqrt{2}-1 \right|= \sqrt{2}\) (hence \((\beta ^p-1)^2 \le 2\)), finally we have

$$\begin{aligned} \left|\left( \ell \beta ^p - (\ell +1)\right) - \beta ^{\mu } \left( -D^{1/2}\right) ^{(p-q)/2} \left( \beta ^p-1\right) ^2 \right|\le & {} \ell \left|\beta ^p \right|+ (\ell + 1) + 2 \left|\beta ^{\mu } \right|D^{(p-q)/2} \nonumber \\< & {} 2 \ell + 1 + 6 D^{p-q} \Delta _p. \end{aligned}$$
(18)

The product of the left-hand side of (17) and (18) gives the absolute value of the norm of a non-zero algebraic integer (in the field \({\mathbb {Q}}(\sqrt{D})\)), hence it is at least 1. Then after reordering the product we immediately obtain

$$\begin{aligned} \alpha ^{\frac{\ell }{b}+p} < \left( D^{(p-q)/2} \Delta _p z_{p, q, k}(\ell )\right) \left( 2 \ell + 1 + 6 D^{p-q} \Delta _p\right) . \end{aligned}$$
(19)

The left-hand side is exponential, while the right-hand side is a cubic polynomial in \(\ell\). This will lead to \(\ell \le \ell _1\), an upper bound on \(\ell\). Obviously, (19) is larger if one compares (19) and (16). So the final unified bound is provided by \(\ell \le \ell _1=\max \{\ell _0,\ell _1\}\) if pq, and k are fixed.

3.3 Computer verification

For each integer k in the range \(k=2,\dots ,10\), and for each pair (pq) satisfies \(1\le p,q\le 10\) we applied (19) to compute an upper bound on \(\ell\). The bound is derived from the numerical solution to (19) for \(\ell\) in each of the \(9\cdot 10^2=900\) cases. We implemented a simple algorithm with three nested loops in Maple. The floor of the largest bound ever occurred is 972. Thus we took \(\ell \le 972\) in general, and we checked for each eligible \(\ell\) if the left-hand side of (5) is a qth power for some \(2\le q\le 10\). In case of \(q=1\), we tested whether the left-hand side of (5) is a term \(G_n\). Obviously, \(G_n\) becomes larger than \(G_1^p+2G_2^p+\cdots +\ell G_\ell ^p\) if n is large enough. The only one non-trivial solution we found is given in the theorem.

Now we go back to the proof of the theorem, and analyze the remaining exceptional case when the left-hand side of (14), or equivalently the left-hand side of (17) vanishes.

4 If the absolute value in (17) is zero

Recall \(k\ge 2\). Suppose that the left-hand side of (17) is zero. Writing out the details we see that

$$\begin{aligned} \left( \sqrt{D}\right) ^{q-p}\left( \ell \alpha ^p-\ell -1\right) ={\left( \alpha ^p-1\right) ^2}\alpha ^{nq-p(\ell +1)} \end{aligned}$$

holds. Take the conjugates in \({\mathbb {Q}}(\sqrt{D})\) of both sides by replacing \(\sqrt{D}\) by \(-\sqrt{D}\). It results

$$\begin{aligned} \left( -\sqrt{D}\right) ^{q-p}\left( \ell \beta ^p-\ell -1\right) ={\left( \beta ^p-1\right) ^2}\beta ^{nq-p(\ell +1)}. \end{aligned}$$

The product of the two equalities above becomes

$$\begin{aligned} D^{q-p}\left( (-1)^p\ell ^2-\ell (\ell +1)H_p+(\ell +1)^2\right) =\pm \left( (-1)^p-H_p+1\right) ^2, \end{aligned}$$
(20)

where we used that \(\alpha \beta =-1\), \(\alpha ^p+\beta ^p=H_p\). Recall that \(H_p\) is the pth term of the associate sequence of \(\{G_m\}\). Distinguish two cases according to the parity of p, and start with the easier case.

Case p is even.

Now, from (20) we derive

$$\begin{aligned} (H_p-2)\ell ^2+(H_p-2)\ell -1=\pm D^{p-q}(H_p-2)^2. \end{aligned}$$
(21)

Obviously, \(H_p-2\ne 0\).

If \(p-q\) is non-negative, then \(D^{p-q}\in {\mathbb {N}}\). Henceforward \(H_p-2\) divides 1, so \(H_p-2=\pm 1\). Thus \(H_p=3\) or \(H_p=1\), both contradict to the parity of p. Indeed, only \(p=1\) is possible with \(k=3\), and \(k=1\), respectively.

Suppose secondly that \(p-q<0\). The left-hand side of (21) is integer. Thus the right-hand side is so. Let \(\gamma =(H_p-2)^2/D^{q-p}\in {\mathbb {N}}\). Clearly, \(\gamma \mid (H_p-2)^2\). If \(\gamma \ne 1\), then there exists a positive integer \(\gamma _1\ne 1\) (for instance, the radical of \(\gamma\)) such that \(\gamma _1\mid \gamma\) and \(\gamma _1\mid (H_p-2)\). Let \(\gamma =\gamma _1\gamma _2\) and \(H_p-2=\gamma _1\gamma _3\) for the suitable positive integers \(\gamma _2\) and \(\gamma _3\). The equation \((H_p-2)\ell ^2+(H_p-2)\ell -1=\pm \gamma\) is equivalent to

$$\begin{aligned} \gamma _1\gamma _3\ell ^2+\gamma _1\gamma _3\ell -1=\pm \gamma _1\gamma _2, \end{aligned}$$

which is a contradiction via \(\gamma _1\mid 1\). Finally, assume that \(\gamma =1\). Now the corresponding equation is

$$\begin{aligned} (H_p-2)\ell ^2+(H_p-2)\ell -1=\pm 1. \end{aligned}$$

Then \((H_p-2)\ell (\ell +1)\) is either 0 or 2, both cases are impossible since \(\ell \ge 2\) and \(H_p\ne 2\).

Case p is odd.

Now equation (20) simplifies to

$$\begin{aligned} H_p\ell ^2+(H_p-2)\ell -1=\pm D^{p-q}H_p^2. \end{aligned}$$
(22)

The left-hand side is positive since \(\ell \ge 2\), \(H_p\ge H_1\ge k\ge 2\), and \(D>0\). Thus we exclude the minus sign on the right-hand side of (22).

Consider the sequence \(\{H_m\}\) modulo \(D=k^2+4\). It is periodic with the period \((2,k,-2,-k)\), see the initial values and the recurrence rule of \(\{H_m\}\). Since \(2\le k<D\) we observe that \(D\not \mid H_p\). Moreover if the odd prime \(k_0\) divides D, then \(k_0\not \mid H_p\) because \(\gcd (D,k)=\gcd (4,k)\mid 4\).

We can easily deduce that \(p\ge q\). Contrary, if \(q-p>0\), then

$$\begin{aligned} \frac{H_p^2}{D^{q-p}}=H_p\ell ^2+(H_p-2)\ell -1 \end{aligned}$$
(23)

is an integer. If there exists an odd prime \(k_0\) such that \(k_0\mid D\), then this \(k_0\) does not divide \(H_p^2\), a contradiction. Hence \(D=k^2+4=2^w\) for some positive integer w. The only possibility is \(2^2+4=2^3\), so \(k=2\). In this case \(8\mid H_p^2\), subsequently \(4\mid H_p\) leads to a contradiction because every term of the sequence \(\{H_n\}\) is congruent to 2 modulo 4.

Thus \(r=p-q\ge 0\) holds. The case \(p=1\) will be examined later. Suppose that \(p\ge 3\). Insert (22) into the form

$$\begin{aligned} H_p\ell ^2+H_p\ell -(2\ell +1)=D^{r}H_p^2. \end{aligned}$$
(24)

It implies \(H_p\mid (2\ell +1)\), i.e. \(H_p\) is odd. Consequently, k is odd, too (see the note after the list of the first few elements in Introduction). Consider now the sequence \(\{H_m\}\) modulo 2 if k is odd. The corresponding period is (0, 1, 1), so \(3\not \mid p\). Thus we can suppose \(p\ge 5\). The equality \(aH_p=2\ell +1\) with a suitable positive odd integer a provides \(\ell =(aH_p-1)/2\). Insert it into (24), which simplifies

$$\begin{aligned} a^2H_p^2-(4a+1)=4D^rH_p. \end{aligned}$$
(25)

First \(H_p\mid (4a+1)\) follows, entailing \(H_p-1\le 4a\). On the other hand we obtain

$$\begin{aligned} 4a+1\le 5a< \frac{a^2H_p^2}{26791}. \end{aligned}$$

Really, we can deduce \(H_p\ge H_5\ge 3^5+5\cdot 3^3+5\cdot 3 =393> 366\), and then \(H_p^2/5>366^2/5=26791.2\). Thus we have

$$\begin{aligned} 4D^rH_p=a^2H_p^2-(4a+1)>a^2H_p^2-\frac{a^2H_p^2}{26791}=\frac{26790}{26791}a^2H_p^2. \end{aligned}$$

Subsequently,

$$\begin{aligned} a^2H_p<\frac{4\cdot 26791}{26790}D^r<4.00015D^r, \end{aligned}$$

and then

$$\begin{aligned} a<\sqrt{\frac{4.00015D^r}{H_p}}<\frac{2.00004D^{r/2}}{H_p^{1/2}}. \end{aligned}$$

Hence

$$\begin{aligned} (H_p-1)H_p^{1/2}\le 4aH_p^{1/2}<8.0002D^{r/2}. \end{aligned}$$
(26)

Rearranging (25) we see that a is an integer solution to the quadratic equation

$$\begin{aligned} H_p^2a^2-4a-\left( 4D^rH_p+1\right) =0. \end{aligned}$$

The discriminant must be square of an even integer, so there exists a suitable positive integer y such that

$$\begin{aligned} 4+H_p^2\left( 4D^rH_p+1\right) =y^2. \end{aligned}$$
(27)

Observe that \(H_p^2+4=DG_p^2\) (p is odd, \(\alpha \beta =-1\), further see the Binet form in (4)). Combine it with (27) to obtain the equality

$$\begin{aligned} 4D^rH_p^3+DG_p^2=y^2. \end{aligned}$$
(28)

In the prime factorization

$$\begin{aligned} D=k^2+4=\pi _1^{\alpha _1}\pi _2^{\alpha _2}\cdots \pi _s^{\alpha _s}, \end{aligned}$$

there exists an exponent, say \(\alpha _1\) which is odd. Otherwise \(k^2+4\) should be a square, a contradiction. We know that \(\pi _1\ne 2\) since k is odd. Also we see \(\pi _1\ne 3\) because \(k^2+4\) is congruent to either 1 or 2 modulo 3. So \(\pi _1\ge 5\). Let \(\delta\) is a positive real number such that \(\pi _1^\delta \ge \pi _2^{\alpha _2}\cdots \pi _s^{\alpha _s}\). Chose even another positive real number \(\varepsilon\) with the property

$$\begin{aligned} D=k^2+4\le \pi _1^{\alpha _1+\delta }\le D^{1+\varepsilon }. \end{aligned}$$
(29)

Clearly, \(\delta\) and \(\varepsilon\) exist.

The crucial point now is to determine the \(\pi _1\)-adic valuation \(\nu _{\pi _1}(.)\) of the three terms in (28). Let \(c=\nu _{\pi _1}(G_p)\). The result of Sanna (see Lemma 6) provides \(\nu _{\pi _1}(G_p)=\nu _{\pi _1}(p)\) because \(5\le \pi _1\mid D\). Consequently, \(c\le \log _{\pi _1}(p)\), and \(\nu _{\pi _1}(DG_p^2)=2c+\alpha _1\), which is odd since \(\alpha _1\) is odd. Furthermore assume that \(\nu _{\pi _1}(y)=d\ge 0\), which entails \(\nu _{\pi _1}(y^2)=2d\), an even integer not equal to \(2c+\alpha _1\). Observe that \(D^r\) coprime to 4 provided k is odd. The greatest common divisor \(\gcd (D,H_p)=1\) since k is odd and \(H_m\) is periodic modulo D with period \((2,k,-2,-k)\). So \(\nu _{\pi _1}(4D^rH_p^3)=r\alpha _1\). Equality (28) can be fulfilled if \(\kappa =\min \{r\alpha _1,2c+\alpha _1,2d\}\) equals exactly two values of the three ones such that the third one is the largest. The two possibilities \(\kappa =r\alpha _1=2c+\alpha _1<2d\) and \(\mu =r\alpha _1=2d<2c+\alpha _1\) together imply \(r\alpha _1\le 2c+\alpha _1\), and equivalently

$$\begin{aligned} r\le \frac{2c}{\alpha _1}+1\le \frac{2\log _{\pi _1}(p)}{\alpha _1}+1=\log _{\pi _1}\left( \pi _1p^{2/\alpha _1}\right) . \end{aligned}$$

We apply this and (29) as follows:

$$\begin{aligned} D^r\le & {} \left( \pi _1^{\alpha _1+\delta }\right) ^{\log _{\pi _1}\left( \pi _1p^{2/\alpha _1}\right) }= \left( \pi _1p^{2/\alpha _1}\right) ^{\alpha _1+\delta }=\pi _1^{\alpha _1+\delta }p^{2(\alpha _1+\delta )/\alpha _1} \\\le & {} D^{1+\varepsilon }p^{2(\alpha _1+\delta )/\alpha _1}. \end{aligned}$$

Combining it with (26) and Corollary 3 we have

$$\begin{aligned} \alpha ^{(p-1)/2}(\alpha ^{p-1}-1)<H_p^{1/2}(H_p-1)<8.0002D^{r/2}<8.0002D^{(1+\varepsilon )/2}p^{1+\delta /\alpha _1}. \end{aligned}$$

The left-hand side is exponential in p while the right-hand side is a power of p (\(\alpha\), D, \(\alpha _1\) are positive constants, \(\varepsilon\), \(\delta\) are non-negative constants), and it allows us to have an upper bound \(b_p\) on p. A short verification for each k in \(\{3,5,7,9\}\) admits, in summary that \(b_p<3\), a contradiction. We note that \(k^2+4\) is always prime if \(k\in \{3,5,7\}\), and if \(k=9\), then \(k^2+4=5\cdot 17\). In this latter case \(\alpha _1=1\) with \(\pi _1=17\), and then \(\delta =0.5681\), \(\varepsilon =0.000025\). If \(D=k^2+4\) is prime we obviously take \(\delta =\varepsilon =0\).

Only \(p=1\) remains to check with \(r=p-q\ge 0\). So \(q=1\) and \(H_p=H_1=k\) also hold. Equation (23) becomes

$$\begin{aligned} k\ell ^2+(k-2)\ell -1=k^2, \end{aligned}$$

or equivalently

$$\begin{aligned} \ell ^2(\ell +1)^2-(8\ell +4)=K^2, \end{aligned}$$

where \(K=2k-\ell (\ell +1)\). If \(\ell >4\), then the left-hand side is smaller then the square \(\ell ^2(\ell +1)^2\) and larger then \((\ell (\ell +1)-1)^2\), so it cannot be a square. One can easily check the two cases \(\ell =2\) and \(\ell =3\). The second one does not give integer k, but the first one does: \(k=1\) or \(k=5\). Note that we investigate the problem with \(k\ge 2\), and the synod \(k=5\), \(p=q=1\), \(\ell =2\) provides no solution to (5).