Left side possibilities:
A, B, C and D square, square root
15 21 28 36 100 10
780 820 861 903 3364 58
28203 28441 28680 28920 114244 338
968136 969528 970921 972315 3880900 1970
32946903 32955021 32963140 32971260 131836324 11482
1119567540 1119614860 1119662181 1119709503 4478554084 66922
Right side possibilities:
E, F, G and H which triangles square, square root
1 6 15 28 1 3 5 7 100 10
28 78 153 253 7 12 17 22 1024 32
91 153 231 325 13 17 21 25 1600 40
190 351 561 820 19 26 33 40 3844 62
28 1953 6903 14878 7 62 117 172 47524 218
630 861 1128 1431 35 41 47 53 8100 90
45 2415 8385 17955 9 69 129 189 57600 240
1 3240 12720 28441 1 80 159 238 88804 298
666 1035 1485 2016 36 45 54 63 10404 102
351 1953 4851 9045 26 62 98 134 32400 180
136 2850 9045 18721 16 75 134 193 61504 248
406 2415 6105 11476 28 69 110 151 40804 202
325 2850 7875 15400 25 75 125 175 52900 230
820 3240 7260 12880 40 80 120 160 48400 220
1711 2415 3240 4186 58 69 80 91 23104 152
1485 3570 6555 10440 54 84 114 144 44100 210
2278 2850 3486 4186 67 75 83 91 25600 160
1225 4656 10296 18145 49 96 143 190 68644 262
666 8778 26106 52650 36 132 228 324 176400 420
703 8778 25878 52003 37 132 227 322 174724 418
3655 4851 6216 7750 85 98 111 124 44944 212
4095 8001 13203 19701 90 126 162 198 90000 300
3321 10878 22791 39060 81 147 213 279 152100 390
5995 7140 8385 9730 109 119 129 139 62500 250
253 22155 79401 171991 22 210 398 586 547600 740
6903 8778 10878 13203 117 132 147 162 79524 282
28 32640 126756 282376 7 255 503 751 883600 940
946 25878 84666 177310 43 227 411 595 577600 760
4186 22155 54285 100576 91 210 329 448 362404 602
325 38781 141246 307720 25 278 531 784 976144 988
3403 25878 69378 133903 82 227 372 517 465124 682
100 is the only square appearing on both lists, and so the first line on each list is the correct one.
S = 2 (A+B+C+D) = 200; W=36, X=49, Y=64, Z=51
Q = 2 (E+F+G+H) = 100; J=7, K=21, L=43, M=29
DECLARE FUNCTION tr# (n#)
DECLARE FUNCTION isTri# (t#)
DEFDBL A-Z
CLS
OPEN "triangsq.txt" FOR OUTPUT AS #2
a = 1: b = 3: c = 6: d = 10
sum = a + b + c + d: adder = 4
DO
sr = INT(SQR(sum) + .5)
IF sr * sr = sum THEN PRINT a; b; c; d, sum; sr: PRINT #2, a; b; c; d, sum; sr
adder = adder + 1
e = d + adder
sum = sum - a + e
a = b: b = c: c = d: d = e
LOOP UNTIL sr > 100000
PRINT : PRINT
PRINT #2, : PRINT #2,
FOR t = 3 TO 10000
FOR a = 1 TO t / 2
IF a < t / 2 THEN
b = t - a
t1 = tr(a)
t2 = tr(b)
t3 = tr(2 * b - a)
t4 = tr(3 * b - 2 * a)
tot = 2 * (t1 + t2 + t3 + t4)
sr = INT(SQR(tot) + .5)
IF sr * sr = tot THEN
PRINT t1; t2; t3; t4, isTri(t1); isTri(t2); isTri(t3); isTri(t4); , tot; sr
PRINT #2, t1; t2; t3; t4, isTri(t1); isTri(t2); isTri(t3); isTri(t4); , tot; sr
ct = ct + 1
IF ct > 30 THEN END
END IF
END IF
NEXT a
NEXT t
CLOSE
FUNCTION isTri (t)
n = INT(SQR(t * 2))
np = n + 1
IF n * np = 2 * t THEN isTri = n: ELSE isTri = 0
END FUNCTION
FUNCTION tr (n)
tr = n * (n + 1) / 2
END FUNCTION
|
Posted by Charlie
on 2009-08-26 18:11:23 |