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

Home > Numbers
3 Cubes #2 (Posted on 2024-02-18) Difficulty: 3 of 5
The digits of 5^3, i.e. 125, can be rearranged to form 8^3, 512.

Find the smallest cube whose digits can be rearranged to form 2 other cubes.

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.)
Solution computer solution | Comment 2 of 4 |
clearvars,clc
ct=0;
for n=5:10000
  cube=n^3;
  cset=unique(str2double(string(perms(num2str(cube)))));
  cubes=[];
  for i=1:length(cset)
    if iscube(cset(i))
      cubes(end+1)=cset(i);
    end
  end
  if length(cubes)>2
    disp(cubes)
    ct=ct+1;
    if ct>=20
      break
    end
  end

end

function ic=iscube(x)
    cr=round(x^(1/3));
    if cr^3==x
      ic=true;
    else 
      ic=false;
    end
end

did not weed out leading zeros, as the point where that was possible to check is buried in a nested type conversion. Some extra code could have checked the proposed solutions, but it's easy enough to check manually.

It's possible to find by looking:

         125         512      125000      512000
         125         512      125000      512000
           1        1000     1000000
        1331     1030301     1331000
        1331     1030301     1331000
           8        8000     8000000
       10648      140608    10648000
          27       27000    27000000
    41063625    56623104    66430125
       42875       54872    42875000    54872000
       42875       54872    42875000    54872000
    41063625    56623104    66430125
          64       64000    64000000
    41063625    56623104    66430125
       91125      110592    91125000
      103823    30080231   103823000
       91125      110592    91125000   110592000
         125         512      125000      512000   125000000   512000000
       10648      140608    10648000   140608000
Operation terminated by user during str2double

The line

    41063625    56623104    66430125
    
shows that 41063625 is the first such cube.

The three are respectively the cubes of 345, 384, and 405.

  Posted by Charlie on 2024-02-18 13:39:36
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 (9)
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