Find all positive integers N such that the concatenation of N and 7N contains each of the 10 digits exactly once.
for n=1000:99999
ns=char(string(n));
n7s=char(string(7*n));
cat=[ns n7s];
if length(cat)==10
if length(unique(cat))==10
disp([n 7*n])
end
end
end
finds n = 14076; 7*n = 98532.
|
Posted by Charlie
on 2023-09-23 08:58:01 |