# Solving Diophantine equation with conditions using Mathematica

how to solve exponential diophantine equation $x^2 + 2^a*5^b = y^n$, $(x, y)$, $a>= 0$, $b>= 0$, $x>= 1$, $y>= 1$, $n= 3$ with Mathematica. I want to find out all solutions for $x, y, a, b$. Please help me with this.

I tried with FindInstance but could not get.

Do not believe, that you can get a general rule for all solutions, but with the following code you get a lot of solutions for a and b up to 50 and x and y up to 100 000.

eq[a_, b_, x_, y_] = x^2 + 2^a*5^b == y^3;

tab1 = Flatten[
Table[{a, b, x, y} /.
Solve[eq[a, b, x, y] && 1 <= x < 10^5 && 1 <= y < 10^5, {x, y},
Integers], {a, 0, 50}, {b, 0, 50}], 1];

list1 = Flatten[DeleteCases[tab1, {_, _, x, y}], 1] // Sort

(*    Points not shown here, see the graph below    *)


Test, that all are solutions of the eq

 Union[eq[Sequence @@ #] & /@ list1]

(*     True     *)

Graphics[{Point[{#[], #[]}],
Text[{#[], #[]}, {#[], #[]}]} & /@ list1,
Axes -> True, AxesOrigin -> {0, 0}, AxesLabel -> {x, y},
AspectRatio -> 1/2, ImageSize -> 800,
PlotLabel -> "x-y-Solutions for given {a,b}"] 