Please tell me how to solve this equation using Mathematica:
x^3 + (Rev(x))^3 = y^2
where x is a 2-digit integer and Rev(x) is the reverse of x
Please tell me how to solve this equation using Mathematica:
x^3 + (Rev(x))^3 = y^2
where x is a 2-digit integer and Rev(x) is the reverse of x
I wouldn’t know how to do it with FindInstance, but a table is a simpler way:
Table[{
x,
x^3,
revx3 = FromDigits[Reverse[IntegerDigits[x]]]^3,
sum = revx3 + x^3,
y = Sqrt[sum]
}, {x, 10, 99}] // Grid
Looks like 56 is a solution…
Thank you C ormullion. I knew the solution(s) but I didn’t know the syntax. I should have said that I was only looking for integer solutions.
One has to specify it completely
In[7]:= FindInstance[(10 x1 + x2)^3 + (10 x2 + x1)^3 == y^2 && y > 0 &&
0 < x1 < 10 && 0 < x2 < 10, {x1, x2, y}, Integers]
Out[7]= {{x1 -> 5, x2 -> 6, y -> 671}}
and yes
In[5]:= Sqrt[56^3 + 65^3]
Out[5]= 671
56 is a solution and 56 is the solution:
In[8]:= FindInstance[(10 x1 + x2)^3 + (10 x2 + x1)^3 == y^2 && y > 0 &&
0 < x1 < 10 && 0 < x2 < 10, {x1, x2, y}, Integers, 4]
Out[8]= {{x1 -> 5, x2 -> 6, y -> 671}, {x1 -> 6, x2 -> 5, y -> 671}}
Thank you, Udo.
That is just what I wanted and avoids needing FromDigits[Reverse[IntegerDigits[]]] which was giving me problems.