>2. What's a number that fits this formula:
>
>a^3 + b^3 + c^3 = x
>where x is a 3-digit number xyz and
>x^3 + y^3 + z^3 = abc.


Ok, this didn't turn out to be too hard either:

on cubit
   repeat with a = 100 to 999
     v = string(a)
     t = 0
     repeat with b = 1 to 3
       t = t + power(value(char b of v),3)
       if t > 99 and t < 1000 then
         v2 = string(t)
         t2 = 0
         repeat with c = 1 to 3
           t2 = t2 + power(value(char c of v2),3)
         end repeat
       end if
     end repeat
     if v = t2 then put v && integer(t)
   end repeat
end


cubit
-- "136 244"
-- "153 153"
-- "244 136"
-- "370 370"
-- "371 371"
-- "407 407"

So, the literal answer to Kerry's question is that there isn't an 
abc, xyz pair of numbers, if we take it that the numbers are six 
different integers. But if any of the numbers are allowed to equal 
another number then there are five answers (136, 244 appears twice). 
Interesting that four of the five are the same number, leaving the 
136,244 being the answer that Kerry may have had in mind.

Guess I'll go to bed thinking about numbers now!


[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to