  The main aim of this article is to find all solutions of the Diophantine
equation $x^2 + p^k=y^n$ where $p \equiv 1 \pmod 4$, $\frac{p-1}{3}$ is a
perfect square and the class number of $\mathbb{Z}[\sqrt{-p}]$ is $2$. In this
article, I used a method involving prime factorization and class numbers which
is different from using congruent number argument which is widely used in this
type of problem.
