0
|
6162 Views
|
4 Replies
|
2 Total Likes
View groups...
Share
GROUPS:

Mathematica: A simple example of FindInstance?

Posted 11 years ago
 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
4 Replies
Sort By:
Posted 11 years ago
 Thank you, Udo. That is just what I wanted and avoids needing FromDigits[Reverse[IntegerDigits[]]] which was giving me problems.
Posted 11 years ago
 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}] // GridLooks like 56 is a solution...
Posted 11 years ago
 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.
Posted 11 years ago
 One has to specify it completelyIn[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 yesIn[5]:= Sqrt[56^3 + 65^3]Out[5]= 67156 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}}