A Wagstaff prime is a prime number of the form (2p+1)/3, where p is an odd prime. For an integer k≥2, the sequence of k-generalized Pell numbers (Pn(k))n≥2−k is the linear recurrence of order k given by Pn(k)=2Pn−1(k)+Pn−2(k)+⋯+Pn−k(k) for n≥2, with initial values P2−k(k)=⋯=P0(k)=0 and P1(k)=1. For k=2 this is the classical Pell sequence. Motivated by the recent determination of the Wagstaff primes in the k-Fibonacci and k-Lucas sequences, we study the exponential Diophantine equation Pn(k)=(2p+1)/3 in positive integers n,k and an odd prime p≥3, with k≥2. We show that this equation has no solutions, that is no k-Pell number is a Wagstaff prime. The proof combines linear forms in logarithms of algebraic numbers with reduction based on the theory of continued fractions, together with a computational verification in the remaining finite range.
Introduction
Background
The search for terms of a linear recurrence sequence that possess a prescribed arithmetic shape is a classical theme of Diophantine Number theory. Over the last two decades, the tools of Baker’s theory of linear forms in logarithms, in the explicit form due to [15] (see also [11]), combined with reduction methods such as the Baker–Davenport lemma in the version of [12] have made it possible to determine completely the members of families of sequences such as generalized Fibonacci and Lucas sequences that are, for instance, powers of two [10], repdigits [5], Mersenne numbers [6, 1], or Fermat numbers [7].
A Wagstaff prime is a prime number of the form
Wp=32p+1,
where p is an odd prime. The first few Wagstaff primes are 3, 11, 43, 683, 2731, 43691, …, corresponding to p=3,5,7,11,13,17,… (see sequence A000979 in [18]). They are named after Samuel S. Wagstaff Jr. and are closely tied to Mersenne primes through the New Mersenne Conjecture of [2]. It is not known whether there are infinitely many Wagstaff primes, and their primality has been studied both through compositeness tests [4] and through the search for probable primes [17].
Very recently, Wagstaff primes have been sought inside generalized Fibonacci-type sequences. For k≥2, let (Fn(k))n≥2−k be the k-generalized Fibonacci sequence, given by Fn(k)=Fn−1(k)+⋯+Fn−k(k) with initial values F2−k(k)=⋯=F0(k)=0 and F1(k)=1. [16] solved the equation Fn(k)=(2p+1)/3 and proved that the only Wagstaff prime appearing in any k-Fibonacci sequence is 3, namely F4(2)=3. Shortly afterwards, [3] treated the k-Lucas sequence (Ln(k))n≥2−k, whose initial values are L0(k)=2, L1(k)=1 and Lj(k)=0 for 2−k≤j≤−1, and showed that the equation Ln(k)=(2p+1)/3 has only the solutions (n,k,p)∈{(5,2,5),(6,4,7)}∪{(2,k,3):k≥2}; in particular the Wagstaff primes 3, 11 and 43 occur in this family.
The present paper considers the same question for the k-generalized Pell numbers, studied by [9]. For an integer k≥2, this is the sequence (Pn(k))n≥2−k defined by the recurrence
Pn(k)=2Pn−1(k)+Pn−2(k)+⋯+Pn−k(k),n≥2,
with initial conditions P2−k(k)=P3−k(k)=⋯=P0(k)=0 and P1(k)=1. For k=2 we recover the Pell numbers. Although the k-Pell sequences resemble the k-Fibonacci and k-Lucas sequences, the argument cannot be transferred verbatim from the previous two papers.
Let p be an odd prime. The main result of this paper is the following.
Main Result
Theorem 1.1. Let (Pn(k))n≥2−k be the sequence of k-generalized Pell numbers. The Diophantine equation
Pn(k)=32p+1(1)
has no solutions in integers n≥1, k≥2 and primes p≥3.
Methods
Preliminaries
The following identity, taken from [14], relates Pn(k) to the m-th Fibonacci number where m=2n−1. It states that
Pn(k)=F2n−1,(2)
for all 1≤n≤k+1, while the next term satisfies Pk+2(k)=F2k+3−1. The characteristic polynomial of the sequence (Pn(k))n≥2−k is
Ψk(x)=xk−2xk−1−⋯−x−1.
This polynomial is irreducible over Q[x] and has a unique real root α:=α(k)>1, with all other roots lying inside the unit circle, see [9]. Moreover, the root α satisfies
φ2(1−φ−k)<α<φ2,k≥2,where φ:=21+5,(3)
as noted in [9]. Similarly to the case k=2, it has been shown in [9] that
for all 2≤i≤k, where αi are the roots of Ψk(x) inside the unit circle. This shows that fk(α) is not an algebraic integer. Furthermore, Theorem 3.1 in [9] establishes
for all k≥2 and n≥2−k. The first part of (5) provides a Binet-type formula for Pn(k), while the second inequality shows that the influence of the roots inside the unit circle is negligible.
A sharper estimate appears in Lemma 2 of [8], valid under a more restricted range of n relative to k. Specifically, if k≥30 and n>1, then
Let γ be an algebraic number of degree d, and let its minimal polynomial over Z be
u0xd+u1xd−1+⋯+ud=u0i=1∏d(x−γ(i)).
where the coefficients ui are coprime integers with u0>0, and γ(i) denote the conjugates of γ. The logarithmic height of γ is defined as
h(γ)=d1(logu0+i=1∑dlogmax{∣γ(i)∣,1}).
In particular, for a rational number r/s with gcd(r,s)=1 and s>0, the logarithmic height is h(r/s)=logmax{∣r∣,s}. The following standard properties of logarithmic heights will be applied without further reference:
(a) h(γ1±γ2)≤h(γ1)+h(γ2)+log2,
(b) h(γ1γ2±1)≤h(γ1)+h(γ2),
(c) h(γs)=∣s∣h(γ) for any integer s.
Based on these properties, it follows from [9 Lemma 3] that
h(fk(α))<4klogφ+klog(k+1),for all k≥2.(7)
The following theorem, proved in [15] and cited in [11 Theorem 9.4], is fundamental in bounding variables in the Diophantine equation (1). Let K be a number field of degree D, and let γ1,…,γt∈K be non-zero elements with integers b1,…,bt. Define
B=max{∣b1∣,…,∣bt∣},Γ=γ1b1⋯γtbt−1,
endsmid=1
and let A1,…,At be real numbers satisfying
Aj≥h′(γj):=max{Dh(γj),∣logγj∣,0.16},1≤j≤t.
We call h′ the modified height (with respect to the field K). With this notation, the main result in [15] implies the following estimate.
Theorem 2.1 (Theorem 9.4 in [11]). Assume that Γ is non-zero and K is real. Then
log∣Γ∣>−1.4⋅30t+3t4.5D2(1+logD)(1+logB)A1⋯At.
The computations initially lead to upper bounds for the variables that are too large to be used directly. We therefore apply a Baker-Davenport type reduction to obtain smaller bounds. The details of this reduction procedure are presented in the following subsection. The precise variant we need is due to Dujella and Pethő [12].
Reduction method
For a real number r we write ∥r∥ for the distance from r to the nearest integer, i.e. ∥r∥:=min{∣r−n∣:n∈Z}.
Lemma 2.1 (Dujella, Pethő, [12]). Let τ=0, C, β and μ be real numbers with C>0 and β>1. Let M>1 be a positive integer and suppose that r/s is a convergent of the continued fraction expansion of τ satisfying s>6M. Put
θ:=∥μs∥−M∥τs∥.
If θ>0, then the inequality
0<∣uτ−v+μ∣<Cβ−ℓ
has no solution in positive integers u,v,ℓ with
logβlog(Cs/θ)≤ℓandu≤M.
The following is an important fact from calculus that will be useful in the proof. If z∈R satisfies ∣z∣<21, then
Finally, we present an analytic argument which is Lemma 7 in [13].
Lemma 2.2 (Lemma 7 in [13]). If r≥1, T>(4r2)r and T>(logx)rx, then
x<2rT(logT)r.
SageMath 10.6 is used to perform all computations in this work.
Proof of Theorem 1.1
Some necessary bounds
For every odd prime p, equation (1) together with the lower estimate for Pn(k) in terms of α gives
αn−2<Pn(k)=32p+1<2p+1<2p+1.
Taking logarithms, we get (n−2)logα<(p+1)log2, so that n<2p+4. In the other direction, the upper estimate for Pn(k) gives
αn−1≥Pn(k)=32p+1>32p>2p−2,
and taking logarithms once more yields (n−1)logα≥(p−2)log2, since logα<2log2 from α<φ2<4, we get n>p/2. Putting the two estimates together,
2p<n<2p+4.(9)
The case n≤k+1
Proposition 3.1. Let k≥2, 1≤n≤k+1 and let p≥3 be an integer. Then Pn(k)=(2p+1)/3.
Proof. By (2), Pn(k)=F2n−1. Put W=(2p+1)/3. Since p≥3, 8∣2p, so 3W=2p+1≡1(mod8). As 3⋅3≡1(mod8), we get W≡3(mod8). The Fibonacci sequence modulo 8 is periodic with period 12; one period is 0,1,1,2,3,5,0,5,5,2,7,1 (indices m=0,…,11), so Fm≡3(mod8) only if m≡4(mod12), in particular only if m is even. Since 2n−1 is odd, F2n−1≡3(mod8), and therefore F2n−1=W.
Remark 3.1. For k=2 the Pell numbers satisfy Pn(2)mod8∈{0,1,2,5,4,5,6,1} (period 8) and are never ≡3(mod8); so Theorem 1.1 is already complete for k=2 by the same argument, without any assumption on n. For k≥3 the residue 3 does occur, so the analytic argument of Subsection 3.3 is needed.
We therefore have that equation (1) has no solution with n≤k+1 and k≥2, and from now on we assume n≥k+2.
The case n≥k+2
Here n≥k+2, and since k≥2 this forces n≥4. We first bound n in terms of k.
Lemma 3.1. Let (n,k,p) be an integer solution of (1) with n≥k+2, k≥2 and p≥3 prime, then
n<1.3⋅1015k6(logk)3.(10)
Proof. We return to (1) and use the closed formula (5). Write
Pn(k)−fk(α)αn=ek(n),
such that ∣ek(n)∣<1/2. Then
32p+1−fk(α)αn=ek(n),
thus
32p−fk(α)αn=ek(n)−31.
Taking absolute values on both sides yields
32p−fk(α)αn≤∣ek(n)∣+31<21+31=65.
Thus we have
32p−fk(α)αn<65.
Dividing through by fk(α)αn yields
2p(3fk(α)αn)−1−1<6fk(α)αn5<αn4.
where we have used the fact that fk(α)>0.276.
Set
∣Γ1∣:=2p(3fk(α)αn)−1−1<αn4.(11)
Clearly, Γ1=0 otherwise we would have 2p=3fk(α)αn. Applying a Galois automorphism σ of the Galois closure of Q(α), with σ(α)=αi for some i>1, and taking absolute values on both sides, we obtain
2p=3∣fk(αi)αin∣.
This is a contradiction, since the left-hand side is at least 8 while the right-hand side is less than 3.
Remark 3.2.The above argument is valid for every p≥3.
To apply Theorem 2.1, we work in the field K:=Q(α), so D=k, and we take t=3 with
We now refine the upper bound for n. For this purpose, we return to (11) and write
Γ1=2p(3fk(α)αn)−1−1=eΛ1−1.
We have already established that Γ1=0, and hence Λ1=0. Assume that n≥3. Then
eΛ1−1=∣Γ1∣<0.5,
and inequality (2.7) gives ∣log(1+Γ1)∣<1.5∣Γ1∣. Therefore, we obtain
Λ1=plog2−nlogα−log(3fk(α)),
which can be rearranged to
nlog2logα−p+log2log(3fk(α))<log26⋅α−n.
Applying Lemma 2.1 with the quantities
τ:=log2logα,μ:=log2log(3fk(α)),C:=log26,β:=α.
Here u=n and v=p. We set M:=9.8⋅1033, which is an upper bound for 2n. For each k∈[2,500] we computed α=α(k), τ and μ to high precision and took the first convergent r/s of τ with s>6M and θ>0. If a convergent gave θ≤0, we passed to the next one. For k=2 this is the convergent s68, with s≈7.0157⋅1034 and θ=0.00202508, which gives
n<logαlog((6/log2)s/θ)<100.52<101.
Over all k∈[2,500] we found θ>4.2⋅10−4, the smallest value occurring at k=105. Writing Hk for the resulting bound on n, the interval [k+2,[Hk]] is non-empty only for k≤86. It therefore remains to check the equation Pn(k)=(2p+1)/3 for 2≤k≤86, n∈[k+2,101] and p∈[3,2n]. A search in SageMath 10.6 found no solutions. We therefore turn to the case k>500.
The case k>500
Suppose that k>500. By Lemma 3.1, we have
n<1.3⋅1015k6(logk)3<φk/2,
where the last inequality holds for all k>500. Thus, n<φk/2, which allows us to apply inequality (2.5). Combining this with (2.4), we obtain
Proceeding via Lemma 2.2, we fix x:=k, r:=1 and T:=4.5⋅1014. We therefore have that T>x/(logx)r, and T>(4r2)r which yields
k<2(4.5⋅1014)(log(4.5⋅1014))<3.1⋅1016.(17)
Applying this new bound for k into inequality (10) gives a new bound for n as n<6.4⋅10118. We proceed to reduce these bounds. To do this, we revisit (13) and rewrite it as
∣Γ2∣:=2p⋅φ−2n⋅(3φ+2)−1<φk/28.
We already showed that Γ2=0, it follows that Λ2=0. Assuming k≥12, then ∣Γ2∣<8φ−k/2<0.5, we obtain the inequality ∣eΛ2−1∣=∣Γ2∣<0.5 and by inequality (8) we get ∣log(1+Γ2)∣<1.5∣Γ2∣. Consequently, we derive
Let τ=[a0;a1,a2,⋯]=[0;1,2,1,1,2,1,6,1,8,⋯] be the continued fraction expansion of τ. Here u=p, v=n and ℓ=k. We set M:=1.28⋅10119, which is an upper bound for 2n. The first convergent of τ with s>6M and θ>0 is s234, with s≈1.22⋅10120 and θ≈0.3202. Hence
k<logφ2log((12/logφ2)s/θ)<1165.(18)
We repeat this reduction procedure but with a new value of M:=2.3⋅1036 evaluated for the reduced bound k in (18) and find that s=s78>6M with θ=0.23119. This gives k<379 which contradicts our original assumption that k>500 and thus the proof is complete.
Acknowledgments
The author gratefully acknowledges Makerere University for providing a conducive environment for this research. This work is dedicated to the memory of Professor Florian Luca (1969–2026), whose remarkable contributions to Number Theory profoundly inspired the author’s research in Diophantine equations and recurrence sequences. It is offered as a modest tribute to his enduring mathematical legacy.
Disclosure statement
The author reports no conflict of interest.
References
Addresses
{sup}1` Department of Mathematics, Makerere University, Kampala, Uganda.
[1]Altassan, A., & Alan, M. (2024). Mersenne numbers in generalized Lucas sequences. Comptes rendus de l’Académie bulgare des Sciences, 77(1), 3–10.DOI
[2]Bateman, P. T., Selfridge, J. L., & Wagstaff, S. S., Jr. (1989). The new Mersenne conjecture. The American Mathematical Monthly, 96(2), 125–128.
[3]Batte, H. (2026). On Wagstaff primes in the k-Lucas number sequence. arXiv preprint arXiv:2602.20387. Accepted for publication in Publicationes Mathematicae.arxiv.org/abs/2602.20387
[4]Berrizbeitia, P., Luca, F., & Melham, R. (2010). On a compositeness test for (2ᵖ + 1)/3. Journal of Integer Sequences, 13(1), Article 10.1.7.
[5]Bravo, J. J., & Luca, F. (2014). Repdigits in k-Lucas sequences. Proceedings–Mathematical Sciences, 124, 141–154.DOI
[6]Bravo, J. J., & Gómez, C. A. (2016). Mersenne k-Fibonacci numbers. Glasnik Matematički, 51(2), 307–319.DOI
[7]Bravo, J. J., & Herrera, J. L. (2020). Fermat k-Fibonacci and k-Lucas numbers. Mathematica Bohemica, 145(1), 19–32.
[8]Bravo, J. J., & Herrera, J. L. (2020). Repdigits in generalized Pell sequences. Archivum Mathematicum, 56(4), 249–262.DOI
[9]Bravo, J. J., Herrera, J. L., & Luca, F. (2021). On a generalization of the Pell sequence. Mathematica Bohemica, 146(2), 199–213.DOI
[10]Bravo, J. J., & Luca, F. (2012). Powers of two in generalized Fibonacci sequences. Revista Colombiana de Matemáticas, 46(1), 67–79.
[11]Bugeaud, Y., Mignotte, M., & Siksek, S. (2006). Classical and modular approaches to exponential Diophantine equations I. Fibonacci and Lucas perfect powers. Annals of Mathematics, 163(3), 969–1018. https://doi.org/10.4007/annals.2006.163.969
[12]Dujella, A., & Pethő, A. (1998). A generalization of a theorem of Baker and Davenport. Quarterly Journal of Mathematics, 49(195), 291–306.DOI
[13]Gúzman–Sanchez, S., & Luca, F. (2014). Linear combinations of factorials and S-units in a binary recurrence sequence. Annales Mathématiques du Québec 38, 169–188.
[14]Kılıç, E. (2008). On the usual Fibonacci and generalized order-k Pell numbers. Ars Combinatoria, 88, 33–45.
[15]Matveev, E. M. (2000). An explicit lower bound for a homogeneous rational linear form in logarithms of algebraic numbers. Izvestiya: Mathematics, 64(6), 1217–1269.
[16]Rezaiguia, L., Qawaqneh, H., & Abdelouahab, M. S. (2026). On the Wagstaff prime numbers in k-Fibonacci sequences. Statistics, Optimization & Information Computing, 15(1), 396–406. https://doi.org/10.19139/soic-2310-5070-2819
[17]Sikkema, D. G. (2024). On Probable Primes of Wagstaff Numbers [Bachelor’s thesis, University of Groningen]. https://fse.studenttheses.ub.rug.nl/33908/1/bMAT2024SikkemaDG.pdf
[18]Sloane, N. J. A. (n.d.). The On-Line Encyclopedia of Integer Sequences, Sequence A000979. Retrieved September 19, 2026, from https://oeis.org/A000979