Find the smallest distinct positive integers, M and N such that you can rearrange the digits of M to get N, and you can rearrange the digits of M
3 to get N
3. [Leading zeroes are not allowed.]
The smallest M and N are 101 and 110 from the table below.
cubes roots
1030301 1331000 101 110
1061208 8120601 102 201
1003003001 1030301000 1001 1010
1006012008 1061208000 1002 1020
1009027027 1092727000 1003 1030
1012048064 1124864000 1004 1040
1030301000 1331000000 1010 1100
1033364331 1334633301 1011 1101
1061208000 8012006001 1020 2001
8012006001 8120601000 2001 2010
8024024008 8242408000 2002 2020
8036054027 8365427000 2003 2030
8048096064 8489664000 2004 2040
8060150125 8615125000 2005 2050
14706125000 15700120064 2450 2504
18274576104 18462541707 2634 2643
27027009001 27270901000 3001 3010
27054036008 27543608000 3002 3020
27081081027 27818127000 3003 3030
27108144064 64144108027 3004 4003
33698267000 36002379608 3230 3302
40814179307 81407931704 3443 4334
40885346125 82540153864 3445 4354
64048012001 64481201000 4001 4010
64096048008 64964808000 4002 4020
124625374875 215352647784 4995 5994
125075015001 125751501000 5001 5010
125450540216 216540450125 5006 6005
125525735343 343735525125 5007 7005
125600960512 512960600125 5008 8005
190705121216 191601072125 5756 5765
235342236024 302652322344 6174 6714
342706083992 990430687232 6998 9968
542140836264 623054684421 8154 8541
939752134875 992518734375 9795 9975
The table is from
clearvars,clc
cubes=[]; cubestr=string.empty(0,1);
for i=1:9999
cubes(end+1)=i^3;
cubestr(end+1)=string(i^3);
end
for i=1:length(cubestr)
c=sort(char(cubestr(i)));
cubestr(i)=string(c);
end
[cubestr idx]=sort(cubestr);
cubes=cubes(idx);
rootpairs=double.empty(0,4);
for i=2:length(cubestr)
if cubestr(i)==cubestr(i-1)
cr1=sort(num2str(cubes(i-1)^(1/3)));
cr2=sort(num2str(cubes(i)^(1/3)));
if cr1==cr2
% disp([cubes(i-1) cubes(i) round(cubes(i-1)^(1/3)) round(cubes(i)^(1/3))])
rootpairs(end+1,:)=[cubes(i-1) cubes(i) round(cubes(i-1)^(1/3)) round(cubes(i)^(1/3))];
end
end
end
rootpairs=sortrows(rootpairs);
disp(' ')
disp(rootpairs)
|
Posted by Charlie
on 2024-03-22 10:00:23 |