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

 A Pythagorean triplet (Posted on 2012-08-28)
Given that a2+b2 = c2
find the value of a*b*c if a+b+c=1000.

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

Taking into consideration the title, a pythagorean triple should consist solely of positive integers and the answer is  a=200, b=375, c=425; a*b*c=31,875,000.

However, based on the puzzle text, the following program also allows for negative integers:

DEFDBL A-Z
CLS
FOR tot = 2 TO 99999
FOR a = 1 TO tot / 2
b = tot - a
csq = a * a + b * b
c = INT(SQR(csq) + .5)
IF c * c = csq THEN
t = a + b + c
IF t >= 1000 THEN
IF t = 1000 THEN PRINT a; b; c, a * b * c
IF -a + b + c = 1000 THEN PRINT -a; b; c, -a * b * c
IF a - b + c = 1000 THEN PRINT a; -b; c, -a * b * c
IF a + b - c = 1000 THEN PRINT a; b; -c, -a * b * c
IF a - b - c = 1000 THEN PRINT a; -b; -c, a * b * c
IF -a + b - c = 1000 THEN PRINT -a; b; -c, a * b * c
IF -a - b + c = 1000 THEN PRINT -a; -b; c, a * b * c
END IF
END IF
NEXT
NEXT

and finds, up to the point where manually stopped:

`  a    b    c                 a*b*c 200  375  425               31875000-250  600  650              -97500000 750 -1000  1250            -937500000 800 -1500  1700            -2040000000 840 -2125  2285            -4078725000 1625  1800 -2425           -7093125000 1500  2000 -2500           -7500000000 1400  2250 -2650           -8347500000 875 -3000  3125            -8203125000 1250  3000 -3250           -12187500000 1200  3500 -3700           -15540000000 900 -4000  4100            -14760000000 1160  4125 -4285           -20503725000 1125  5000 -5125           -28828125000 920 -5250  5330            -25743900000 1100  6000 -6100           -40260000000 1080  7250 -7330           -57393900000 950 -9000  9050            -77377500000 1050  11000 -11050         -127627500000 960 -11500  11540          -127401600000 1040  13500 -13540         -190101600000 968 -14625  14657          -207499149000 1032  16625 -16657         -285784149000 975 -19000  19025          -352438125000 1025  21000 -21025         -452563125000 980 -24000  24020          -564950400000 1020  26000 -26020         -690050400000 984 -30250  30266          -900897756000 1016  32250 -32266         -1057227756000`

But clearly there are no further all-positive solutions, as we've reached the point where a+b alone equals 33266, much more than 1000.

 Posted by Charlie on 2012-08-28 11:14:42

 Search: Search body:
Forums (0)