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

Home > Numbers
Integer Diagonal (Posted on 2023-10-18) Difficulty: 3 of 5
Find a rectangular prism whose edges and main diagonal have integer lengths, such that the squares of the edges are 10-digit pandigital numbers.

See The Solution Submitted by K Sengupta    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
re(2): Computer solution Comment 4 of 4 |
(In reply to re: Computer solution by Charlie)

I had to change the code:


clearvars,clc
pandsr=[];
for i=31992:99380
% for i=11111:31426
  i2=char(string(i^2));
  if isequal(sort(i2),['0123456789'])
    pandsr(end+1)=i;
  end
end
  fprintf(' %d',pandsr)
disp(' ')
l=length(pandsr);
for a=1:length(pandsr)
  for b=a:length(pandsr)
    for c=b:length(pandsr)
idx=[a b c];
 
  dims=pandsr(idx);
  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
  end
end

producing

[35853.0, 40545.0, 59403.0, 80361.999993778153853570646764205]
[40545.0, 40545.0, 40545.0, 70225.999992880129866070311916356]
[45624.0, 91248.0, 91248.0, 136872.0]
[55446.0, 76182.0, 78072.0, 122364.99999591386425850244553059]
[62679.0, 87639.0, 89079.0, 139801.00000715302465629299589512]
The same approximations as before plus the solution, now that duplicates were allowed in the dimensions.

  Posted by Charlie on 2023-10-18 16:08:39
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (3)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information