I wrote a Diophantine equation and tried solving it. Then I got stuck at a stage of the solution.

Problem: Find all $(x,y)$ positive integer pairs that satisfy the equation $5^x - y^2=4$.

My Partial Solution: If $x$ is an even number then $x=2n\quad$ ($n \geq 1$ an integer). Therefore $$ (5^n - y)(5^n + y) = 4$$ and we can write \begin{equation*} \left\{ \begin{split} 5^x-y & = 1 \\ 5^x + y & = 4 \end{split} \right. \end{equation*} Thus, $2\cdot 5^x = 5$ and there is no positive integer solution in this case.

If $x$ is an odd number,

$\bullet$ For $x=1$; $\quad 5^1 -y^2=4 \implies y=1$.

$\bullet$ For $x=3$; $\quad 5^3 -y^2=4 \implies y=11$.

$\bullet$ For $x\geq 5$; I thought of finding a contradiction using modular arithmetic. For example; $x=2k + 3 , \quad$ ($k\geq 1 $ an integer) $125\cdot 25^k - y^2 = 4$. In $\mod 24$, $$5 - y^2 \equiv 4 \pmod{24}$$

But this is not a contradiction. So, I failed. How can I tell if the equation has a solution for $x>3$ or not? Thanks for your interest.

  • $\begingroup$ Yeah, we we can say we multiply roughly by 25 giving $25\cdot 5^x-25\cdot y^2=100$ ... $\endgroup$ Jun 27, 2021 at 15:43
  • 2
    $\begingroup$ If $x=2n+1$ then we can write the above equation as $ 5(5^n-1)(5^n+1)=(y-1)(y+1)$ $\endgroup$
    – Asher2211
    Jun 27, 2021 at 15:58
  • $\begingroup$ Recasting the equation as $5^x=y^2+4$, it is obvious that $y$ can only end in the digits $1,9$ or in other words $y \equiv \pm 1 \bmod 10$. Hence $y^2=100k^2 \pm 20k +1$ $\endgroup$ Jun 27, 2021 at 16:31

2 Answers 2


$$5^{x} - y^2 = 4\tag{1}$$

We take the three cases $x=3a, x=3a+1$, and $x=3a+2.$
The problem can be reduced to finding the integer points on elliptic curves as follows.

$\bullet\ x=3a$
Let $X=5^{a}$, then we get $y^2 =X^3 - 4.$
According to LMFDB, this elliptic curve has integral solutions $(X,y)=(2,\pm 2), (5,\pm 11).$
From $(5,\pm 11),$ we get $(x,y)=(3,11).$

$\bullet\ x=3a+1$
Let $X=5\cdot5^{a}, Y=5y$, then we get $Y^2 =X^3 - 100.$
This elliptic curve has integral solutions $(X,Y)=(5,\pm 5),(10,\pm 30),(34,\pm 198).$
From $(5,\pm 5)$, we get $(x,y)=(1,1).$

$\bullet\ x=3a+2$
Let $X=25\cdot5^{a}, Y=25y$, then we get $Y^2 =X^3 - 2500.$
This elliptic curve has integral solution $(X,Y)=(50,\pm 350).$
We get no solution $(x,y).$

Hence there are only integral solutions $(x,y)=(1,1),(3,11).$


The number $5^x$ is either a perfect square or $5$ times a perfect square for any integer $x$.

Hence either $$m^2-y^2=4\ (1)$$ for $m=5^k$ or $$5n^2-y^2=4\ (2)$$ for $n=5^l$.

In the first equation, $x=2k$. The first equation is can be factored as $$(m-y)(m+y)=4=2^2,$$ so $m$ and $y$ must have the same parity and hence either $m+y=2$ and $m-y=2$ or $m+y=-2$ and $m-y=-2$. This gives $(m,y)=(\pm2,0)$, so $\pm2=5^k$, a contradiction.

In the second equation, $x=2l+1$. The second equation has integer solutions iff $n$ is the odd-indexed Fibonacci number. The equation $2$ is equivalent to $$5(5^l)^2-y^2=4.$$ Since the only Fibonacci numbers which are the powers of $5$ are $1$ and $5$, $l$ is either $0$ or $1$ and hence $(x,y)\in\{(1,1), (3,11)\}$ since $y$ is positive.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .