Since is an odd number it must be perfect square also . So:

Now, if we make substitution we can write :

This equality has integer solutions only if is power of so must be an odd number so we shall make substitution and therefore :

It is obvious that both and must be powers of and this is possible only if , therefore :