MAI is the square of ST.
And:
. . . . . A
M A I
--------------
. . . . . . .
. . . . . . .
. . E N . . .
-------------------
P R I N T E M P S
clearvars
for st=12:sqrt(1000)
stStr=num2str(st);
if length(unique(stStr))==2
maiV=st^2; mai=num2str(maiV);
if length(unique(mai))==3
m=mai(1); a=mai(2); i=mai(3);
mV=str2double(m);
aV=str2double(a);
iV=str2double(i);
for begin=10000:999999
m1=str2double([num2str(begin) a]);
p1=num2str(m1*iV);
if length(p1)==7
p2=num2str(m1*aV);
if length(p2)==7
p3=num2str(m1*mV);
if length(p3)==7
en=p3(3:4);
if length(unique([en mai]))==5
pr=num2str(maiV*m1);
if p3(4)==pr(4) && p3(3)==pr(6)
if ~ismember(a,pr) && pr(1)==pr(8)
if length(pr)==9 && length(unique([pr a]))==9
disp([m1 maiV maiV*m1])
end
end
end
end
end
end
end
end
end
end
end
>> findTheKey
multiplicands product
341737 576 196840512
794302 729 579046158
The second "solution" is spurious, as the third from the last digit of the product does not match the first digit of the second multiplicand, something the program didn't check for.
Reconstructing the multiplication:
>> m1=341737
m1 =
341737
>> m1*6
ans =
2050422
>> m1*7
ans =
2392159
>> m1*5
ans =
1708685
>>
Arranging:
341737
576
---------
2050422
2392159
1708685
---------
196840512
|
Posted by Charlie
on 2024-10-21 10:47:51 |