We will be dealing with two-digit numbers non divisible by 11.
For each such number A there will exist another A’, a number created by inverting the digits of A so 45’=54, 87’=78.
Take for example 2 numbers 36 & 84: their product is the same as the product of those numbers inverted i.e. 63*48.
Find all the couples possessing such feature i.e. AB=(A')*(B').
Rem: to preserve conformity present the smallest number on the LHS of the equation - like 12*42=21*24.
clearvars,clc
pairs= double.empty(0,2);
for n1=10:99
n2=floor(n1/10)+10*mod(n1,10);
p=n1*n2;
if p>0 && n2>9 && n2~=n1
% disp([n1 n2])
pairs(end+1,:)=[n1 n2];
end
end
for i=1:length(pairs)
for j=1:length(pairs)
if i~=j && pairs(j,1) ~= pairs(i,2)
if pairs(i,1)==min([pairs(i,1),pairs(j,1) , pairs(i,2),pairs(j,2)])
if pairs(i,1)*pairs(j,1) == pairs(i,2)*pairs(j,2)
fprintf('%3d *%3d =%3d *%3d =%5d\n', pairs(i,1),pairs(j,1),pairs(i,2),pairs(j,2),pairs(i,2)*pairs(j,2))
end
end
end
end
end
12 * 42 = 21 * 24 = 504
12 * 63 = 21 * 36 = 756
12 * 84 = 21 * 48 = 1008
13 * 62 = 31 * 26 = 806
13 * 93 = 31 * 39 = 1209
14 * 82 = 41 * 28 = 1148
23 * 64 = 32 * 46 = 1472
23 * 96 = 32 * 69 = 2208
24 * 63 = 42 * 36 = 1512
24 * 84 = 42 * 48 = 2016
26 * 93 = 62 * 39 = 2418
34 * 86 = 43 * 68 = 2924
36 * 84 = 63 * 48 = 3024
46 * 96 = 64 * 69 = 4416
|
Posted by Charlie
on 2024-05-23 23:18:04 |