A Heronian triangle has integer sides and integer area.
Find two Heronian triangles which have one side in common, where the other two sides of each are a square and a cube.
clearvars,clc
prev=0;
for common=1:5000
for sr=1:500
sq=sr^2;
for cr=1:400
cu=cr^3;
sides=[common,sq,cu];
if 2*max(sides)<sum(sides)
s=sum(sides)/2;
A=sqrt(-s*(common-s)*(sq-s)*(cu-s));
if A==round(A)
fprintf('%10d',sides,A)
fprintf('\n')
if common==prev
disp('----------------')
end
prev=common;
end
end
end
end
end
finds among its results
common square cube area
3468 3721 2197 3734640
3468 7225 4913 7516890
where 3721 is 61^2, 2197 is 13^3, 7225 is 85^2, and 4913 is 17^3.
|
Posted by Charlie
on 2024-01-19 10:36:20 |