George’s new office has a security
lock in which you have to key in a series of digits, all different, before you
can open the door.
Unfortunately, he
is having trouble committing this security number to memory. So far, he
has memorized a number consisting
a selection of different digits from the
security number.
He made a note of
this memorized number on the memo
sheet on which he was given the security number, but he absent-mindedly
left the paper lying around the house.
When his wife found the paper containing the two numbers, she multiplied them together and found the product
was a seven-digit number in which all
the digits were the same.
What is
George’s security number?
clearvars,clc
for dig=1:9
pr=dig*1111111;
dv=divisors(pr);
for i=1:length(dv)/2
n1=dv(i);
n2=dv(length(dv)+1-i);
n1s=num2str(n1);
n2s=num2str(n2);
tst=n2s;
good=true;
for j=1:length(n1s)
idx=strfind(tst,n1s(j));
if isempty(idx)
good=false;
break
else
tst(idx)='';
end
end
if good
disp([pr n2 n1])
end
end
end
product security "mnemonic"
number
1111111 1111111 1
4444444 2222222 2
8888888 37192 239
9999999 3333333 3
The answer is 37192.
|
Posted by Charlie
on 2024-06-12 13:49:26 |