Find the digits a, b, and c of the two six digit numbers abcabc and ababab, given that
abcabc 55
------ = --
ababab 54
clearvars
idx=combinator(10,3,'p');
digs='0123456789';
abcs=digs(idx);
for i=1:length(abcs)
abc=str2double(abcs(i,:));
abcabc=1001*abc;
if abc>99
ab=str2double(abcs(i,1:2));
ababab=10101*ab;
if 54*abcabc==55*ababab
disp(abc)
end
end
end
finds
abc = 185
|
Posted by Charlie
on 2025-01-20 09:30:00 |