On the Diophantine equation
Let be a square-free positive integer and a prime satisfying . Let denote the class number of the imaginary quadratic field . In this paper, we consider the Diophantine equation and we describe all its integer solutions. Our main tool here is the prominent result of Bilu, Hanrot and Voutier on existence of primitive divisors in Lehmer sequences.