Find a rectangular prism whose edges and main diagonal have integer lengths, such that the squares of the edges are 10-digit pandigital numbers.
The integers whose squares are 10-digit pandigitals are:
32043 32286 33144 35172 35337 35757 35853 37176 37905 38772 39147 39336 40545 42744 43902 44016 45567 45624 46587 48852 49314 49353 50706 53976 54918 55446 55524 55581 55626 56532 57321 58413 58455 58554 59403 60984 61575 61866 62679 62961 63051 63129 65634 65637 66105 66276 67677 68763 68781 69513 71433 72621 75759 76047 76182 77346 78072 78453 80361 80445 81222 81945 83919 84648 85353 85743 85803 86073 87639 88623 89079 89145 89355 89523 90144 90153 90198 91248 91605 92214 94695 95154 96702 97779 98055 98802 99066
Forming rectangular solids with these edges never gives an exact integer diagonal. These three are closest:
sides diagonal
--------------------------
[35853.0, 40545.0, 59403.0, 80361.999993778153853570646764205]
[55446.0, 76182.0, 78072.0, 122364.99999591386425850244553059]
[62679.0, 87639.0, 89079.0, 139801.00000715302465629299589512]
However, a modified version of the below program finds that a solution exists for edges whose squares are 9-digit pandigitals:
sides diagonal
--------------------------
[14676.0, 24276.0, 26733.0, 38979.0]
The integers whose squares are 9-digit pandigitals are:
11826 12363 12543 14676 15681 15963 18072 19023 19377 19569 19629 20316 22887 23019 23178 23439 24237 24276 24441 24807 25059 25572 25941 26409 26733 27129 27273 29034 29106 30384
Program version for 10-digit pandigitals:
clearvars,clc
pandsr=[];
for i=31992:99380
i2=char(string(i^2));
if isequal(sort(i2),['0123456789'])
pandsr(end+1)=i;
end
end
fprintf(' %d',pandsr)
disp(' ')
idx=combinator(84,3,'c');
for i=1:length(idx)
dims=pandsr(idx(i,:));
diag=sqrt(sum(dims.^2));
if abs(diag-round(diag))<.01
dims=vpa(dims);
diag=sqrt(sum(dims.^2));
if abs(diag-round(diag))<.00001
disp([dims diag])
end
end
end
|
Posted by Charlie
on 2023-10-18 12:08:24 |