One thing that makes the exhaustive solution difficult, if not impossible,
is that
the numbers may be negative (as in John Randall's example solution).
On 7/12/07, Raul Miller <[EMAIL PROTECTED]> wrote:
On 7/12/07, Howell, Leonard W. (MSFC-VP62) <[EMAIL PROTECTED]>
wrote:
> Find integers a,b,c,d such that a^3 + b^3 + c^3 +d^3 =31
> and in general, write a program to give the solutions to a^3 + b^3 + c^3
+d^3 =k, k=1,..., 350.
> Of course, some will be the empty set.
> Anyone have an approach for this problem?
Hmm... well, first note that you can simply exhaustively try all
possible combinations -- not as a solution, but simply to get
a handle on the problem:
$+/@>,{4#<^&3 i:4
6561
...
(I choose i: 11 as my stopping point because i:12 yields no further
results in the desired range.)
...
--
Devon McCormick, CFA
^me^ at acm.
org is my
preferred e-mail
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm