Message Boards Message Boards

0
|
5898 Views
|
4 Replies
|
2 Total Likes
View groups...
Share
Share this post:

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
POSTED BY: Mark Nicholas
4 Replies
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...
POSTED BY: C ormullion
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 BY: Mark Nicholas
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}}
POSTED BY: Udo Krause
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 BY: Mark Nicholas
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract