You are given 99 thin rigid rods with lengths 1, 2, 3, ..., 99. You are asked to assemble these into as many right triangles as you wish. What is the largest total area that can be obtained? (Each side of a triangle must be one entire rod.)
clearvars,clc
ct=0; totArea=0;
sq=(1:99).^2;
for a=1:length(sq)-2
asq=sq(a);
for b=a+1:length(sq)-1
bsq=sq(b);
if ismember(asq+bsq,sq)
ct=ct+1;
area=(a*b)/2;
c=sqrt(asq+bsq);
totArea=totArea+area;
fprintf('%3d %3d %3d %7.1f\n',a,b,c,area )
end
end
end
ct
totArea
finds these 50 right triangles:
Area
3 4 5 6.0
5 12 13 30.0
6 8 10 24.0
7 24 25 84.0
8 15 17 60.0
9 12 15 54.0
9 40 41 180.0
10 24 26 120.0
11 60 61 330.0
12 16 20 96.0
12 35 37 210.0
13 84 85 546.0
14 48 50 336.0
15 20 25 150.0
15 36 39 270.0
16 30 34 240.0
16 63 65 504.0
18 24 30 216.0
18 80 82 720.0
20 21 29 210.0
20 48 52 480.0
21 28 35 294.0
21 72 75 756.0
24 32 40 384.0
24 45 51 540.0
24 70 74 840.0
25 60 65 750.0
27 36 45 486.0
28 45 53 630.0
30 40 50 600.0
30 72 78 1080.0
32 60 68 960.0
33 44 55 726.0
33 56 65 924.0
35 84 91 1470.0
36 48 60 864.0
36 77 85 1386.0
39 52 65 1014.0
39 80 89 1560.0
40 42 58 840.0
40 75 85 1500.0
42 56 70 1176.0
45 60 75 1350.0
48 55 73 1320.0
48 64 80 1536.0
51 68 85 1734.0
54 72 90 1944.0
57 76 95 2166.0
60 63 87 1890.0
65 72 97 2340.0
ct =
50
totArea =
37926
The total area is 37,926, but we're challenged to find the largest total area that can be obtained. Presumably it's not this, so there must be a caveat: no rod can be used in more than one triangle, so we must eliminate duplicate rod usage, while reducing the area by as little as possible.
The pairs of triangles that contain duplicate rods, along with their areas, are:
3 4 5 6.0
5 12 13 30.0
5 12 13 30.0
9 12 15 54.0
5 12 13 30.0
12 16 20 96.0
5 12 13 30.0
12 35 37 210.0
5 12 13 30.0
13 84 85 546.0
6 8 10 24.0
8 15 17 60.0
6 8 10 24.0
10 24 26 120.0
7 24 25 84.0
10 24 26 120.0
7 24 25 84.0
15 20 25 150.0
7 24 25 84.0
18 24 30 216.0
7 24 25 84.0
24 32 40 384.0
7 24 25 84.0
24 45 51 540.0
7 24 25 84.0
24 70 74 840.0
7 24 25 84.0
25 60 65 750.0
8 15 17 60.0
9 12 15 54.0
8 15 17 60.0
15 20 25 150.0
8 15 17 60.0
15 36 39 270.0
9 12 15 54.0
9 40 41 180.0
9 12 15 54.0
12 16 20 96.0
9 12 15 54.0
12 35 37 210.0
9 12 15 54.0
15 20 25 150.0
9 12 15 54.0
15 36 39 270.0
9 40 41 180.0
24 32 40 384.0
9 40 41 180.0
30 40 50 600.0
9 40 41 180.0
40 42 58 840.0
9 40 41 180.0
40 75 85 1500.0
10 24 26 120.0
18 24 30 216.0
10 24 26 120.0
24 32 40 384.0
10 24 26 120.0
24 45 51 540.0
10 24 26 120.0
24 70 74 840.0
11 60 61 330.0
25 60 65 750.0
11 60 61 330.0
32 60 68 960.0
11 60 61 330.0
36 48 60 864.0
11 60 61 330.0
45 60 75 1350.0
11 60 61 330.0
60 63 87 1890.0
12 16 20 96.0
12 35 37 210.0
12 16 20 96.0
15 20 25 150.0
12 16 20 96.0
16 30 34 240.0
12 16 20 96.0
16 63 65 504.0
12 16 20 96.0
20 21 29 210.0
12 16 20 96.0
20 48 52 480.0
12 35 37 210.0
21 28 35 294.0
12 35 37 210.0
35 84 91 1470.0
13 84 85 546.0
35 84 91 1470.0
13 84 85 546.0
36 77 85 1386.0
13 84 85 546.0
40 75 85 1500.0
13 84 85 546.0
51 68 85 1734.0
14 48 50 336.0
20 48 52 480.0
14 48 50 336.0
30 40 50 600.0
14 48 50 336.0
36 48 60 864.0
14 48 50 336.0
48 55 73 1320.0
14 48 50 336.0
48 64 80 1536.0
15 20 25 150.0
15 36 39 270.0
15 20 25 150.0
20 21 29 210.0
15 20 25 150.0
20 48 52 480.0
15 20 25 150.0
25 60 65 750.0
15 36 39 270.0
27 36 45 486.0
15 36 39 270.0
36 48 60 864.0
15 36 39 270.0
36 77 85 1386.0
15 36 39 270.0
39 52 65 1014.0
15 36 39 270.0
39 80 89 1560.0
16 30 34 240.0
16 63 65 504.0
16 30 34 240.0
18 24 30 216.0
16 30 34 240.0
30 40 50 600.0
16 30 34 240.0
30 72 78 1080.0
16 63 65 504.0
25 60 65 750.0
16 63 65 504.0
33 56 65 924.0
16 63 65 504.0
39 52 65 1014.0
16 63 65 504.0
60 63 87 1890.0
16 63 65 504.0
65 72 97 2340.0
18 24 30 216.0
18 80 82 720.0
18 24 30 216.0
24 32 40 384.0
18 24 30 216.0
24 45 51 540.0
18 24 30 216.0
24 70 74 840.0
18 24 30 216.0
30 40 50 600.0
18 24 30 216.0
30 72 78 1080.0
18 80 82 720.0
39 80 89 1560.0
18 80 82 720.0
48 64 80 1536.0
20 21 29 210.0
20 48 52 480.0
20 21 29 210.0
21 28 35 294.0
20 21 29 210.0
21 72 75 756.0
20 48 52 480.0
36 48 60 864.0
20 48 52 480.0
39 52 65 1014.0
20 48 52 480.0
48 55 73 1320.0
20 48 52 480.0
48 64 80 1536.0
21 28 35 294.0
21 72 75 756.0
21 28 35 294.0
28 45 53 630.0
21 28 35 294.0
35 84 91 1470.0
21 72 75 756.0
30 72 78 1080.0
21 72 75 756.0
40 75 85 1500.0
21 72 75 756.0
45 60 75 1350.0
21 72 75 756.0
54 72 90 1944.0
21 72 75 756.0
65 72 97 2340.0
24 32 40 384.0
24 45 51 540.0
24 32 40 384.0
24 70 74 840.0
24 32 40 384.0
30 40 50 600.0
24 32 40 384.0
32 60 68 960.0
24 32 40 384.0
40 42 58 840.0
24 32 40 384.0
40 75 85 1500.0
24 45 51 540.0
24 70 74 840.0
24 45 51 540.0
27 36 45 486.0
24 45 51 540.0
28 45 53 630.0
24 45 51 540.0
45 60 75 1350.0
24 45 51 540.0
51 68 85 1734.0
24 70 74 840.0
42 56 70 1176.0
25 60 65 750.0
32 60 68 960.0
25 60 65 750.0
33 56 65 924.0
25 60 65 750.0
36 48 60 864.0
25 60 65 750.0
39 52 65 1014.0
25 60 65 750.0
45 60 75 1350.0
25 60 65 750.0
60 63 87 1890.0
25 60 65 750.0
65 72 97 2340.0
27 36 45 486.0
28 45 53 630.0
27 36 45 486.0
36 48 60 864.0
27 36 45 486.0
36 77 85 1386.0
27 36 45 486.0
45 60 75 1350.0
28 45 53 630.0
45 60 75 1350.0
30 40 50 600.0
30 72 78 1080.0
30 40 50 600.0
40 42 58 840.0
30 40 50 600.0
40 75 85 1500.0
30 72 78 1080.0
54 72 90 1944.0
30 72 78 1080.0
65 72 97 2340.0
32 60 68 960.0
36 48 60 864.0
32 60 68 960.0
45 60 75 1350.0
32 60 68 960.0
51 68 85 1734.0
32 60 68 960.0
60 63 87 1890.0
33 44 55 726.0
33 56 65 924.0
33 44 55 726.0
48 55 73 1320.0
33 56 65 924.0
39 52 65 1014.0
33 56 65 924.0
42 56 70 1176.0
33 56 65 924.0
65 72 97 2340.0
36 48 60 864.0
36 77 85 1386.0
36 48 60 864.0
45 60 75 1350.0
36 48 60 864.0
48 55 73 1320.0
36 48 60 864.0
48 64 80 1536.0
36 48 60 864.0
60 63 87 1890.0
36 77 85 1386.0
40 75 85 1500.0
36 77 85 1386.0
51 68 85 1734.0
39 52 65 1014.0
39 80 89 1560.0
39 52 65 1014.0
65 72 97 2340.0
39 80 89 1560.0
48 64 80 1536.0
40 42 58 840.0
40 75 85 1500.0
40 42 58 840.0
42 56 70 1176.0
40 75 85 1500.0
45 60 75 1350.0
40 75 85 1500.0
51 68 85 1734.0
45 60 75 1350.0
60 63 87 1890.0
48 55 73 1320.0
48 64 80 1536.0
54 72 90 1944.0
65 72 97 2340.0
|
Posted by Charlie
on 2024-07-21 10:50:12 |