How many solutions does the equation $x^2-y^2=5^{29}$ have, given that $x$ and $y$ are positive integers? 
How many solutions does the equation $x^2-y^2=5^{29}$ have, given that $x$ and $y$ are positive integers?

Someone told me that it has $(29+1)/2=15$ solutions. How come? Any other method to solve this?
 A: First, factorise :
$$x^2-y^2=(x-y)(x+y)=5^{29}.$$
Then by the Fundamental Theorem of Arithmetics, both factors must be powers of $5$, i.e.
$$\left\{\begin{array}{}x+y & = & 5^a \\ x-y & = & 5^b,\end{array}\right.$$with $a+b=29$. Since $x+y>x-y$, we must have $a>b$; hence you will have one system for every $15\leq a\leq 29$. Since every system as above has a unique integer solution $$x=\frac{5^{a}+5^b}{2},\quad y=\frac{5^{a}-5^b}{2},$$
we obtain the $15$ solutions.
A: Note $x^2-y^2=(x+y)(x-y)$ so both of these must be factors of $5^{29}$, i.e. powers of $5$.
Let $x+y=5^a$ for some $0 \leq a \leq 29$. Then by the factorisation above, $x-y=5^{29-a}$ and this always has a solution in rational numbers, namely $x=\frac{5^a+5^{29-a}}{2}$, $y=\frac{5^a-5^{29-a}}{2}$.
We do require these to be integers, but this is always true as $5^k$ is always odd and odd+odd=even.
The only other restriction is that they are positive and whilst $x$ necessarily is, $y$ will only be positive when $29-a \leq a$, i.e. $a>14$. Hence any $15 \leq a \leq 29$ works and we have $15$ solutions.
Note that in general factorisations, we could have had $x+y=-5^a$, $x-y=-5^{29-a}$, but this is not allowed as both $x$ and $y$ are positive.
