Determine the three smallest consecutive positive integers such that each of these 3 integers has 5 distinct prime factors.
clearvars,clc
found=false; n=0;
while found==false
n=n+1;
f=unique(factor(n));
if length(f)<5
number=0;
else
number=number+1;
sol(number)=n;
if number==3;
disp(sol)
found=true;
end
end
end
finds 1042404 1042405 1042406.
Then inquiring in the Command Window:
>> for i=1:3 factor(sol(i))
end
ans =
2 2 3 11 53 149
ans =
5 7 13 29 79
ans =
2 17 23 31 43
shows the factors themselves.
|
Posted by Charlie
on 2023-07-20 09:04:44 |