All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 Two expressions (Posted on 2011-12-22)
N is the smallest number which can be represented by two different sums of 4 positive (not necessarily distinct) cubes.
Find N and the corresponding sums.

 No Solution Yet Submitted by Ady TZIDON No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
 computer solution (spoiler) Comment 1 of 1

DEFDBL A-Z
OPEN "twoexps.txt" FOR OUTPUT AS #2
FOR a = 1 TO 40
a3 = a * a * a
FOR b = a TO 40
b3 = b * b * b
FOR c = b TO 40
c3 = c * c * c
FOR d = c TO 40
d3 = d * d * d
sum = a3 + b3 + c3 + d3
PRINT #2, USING "#######"; a3; b3; c3; d3; sum
NEXT
NEXT
NEXT
NEXT
CLOSE

The output file is then sorted on the sum column and read by:

OPEN "twoexps.txt" FOR INPUT AS #1
CLS

DO
prev\$ = l\$
LINE INPUT #1, l\$
IF MID\$(l\$, 30) = MID\$(prev\$, 30) THEN
PRINT prev\$
PRINT l\$
PRINT
ct = ct + 1: IF ct > 12 THEN END
END IF

LOOP UNTIL EOF(1)

the result is:

`     1      1      1    216    219    27     64     64     64    219`
`     1      1    125    125    252     1      8     27    216    252`
`     1      8    125    125    259     8      8     27    216    259`
`     8     27     27    216    278     1     27    125    125    278`
`     1     64    125    125    315     8     27     64    216    315`
`     8     27    125    216    376     1    125    125    125    376`
`     8     27    216    216    467     1    125    125    216    467`
`    27     27    125    343    522     1      1      8    512    522`
`     1    125    125    343    594     8     27    216    343    594`
`     1     64    125    512    702     8      8    343    343    702`
`     1      1     27    729    758     8     64    343    343    758`
`     8     27    216    512    763     1    125    125    512    763`
`    64     64    125    512    765     1      8     27    729    765     `

so the answer is 219 = 1+1+1+216 = 27+64+64+64.

BTW, eyeballing the output, allowing it to continue past the above, indicates the first instance that would satisfy disallowing repeated cubes within a given sum would result in the following as the lowest:

1  +   8  +  27 + 1000 = 1036
27  +  64  + 216 +  729 = 1036

If you want no repeats whatsoever among the eight cubes, then:

1  + 125 +  512 + 1000 = 1638
27  +  64 +  216 + 1331 = 1638

 Posted by Charlie on 2011-12-22 14:09:17

 Search: Search body:
Forums (0)