Find the 6-digit number beginning and ending in the digit 2 that is the product of three consecutive even integers.
The program looks in the required range to find a number such that its cube root rounds to the middle number of such a triple.
clearvars
had=[];
for n=200000:300000
cr=round(n^(1/3));
if mod(cr,2)==0
p=num2str((cr-2)*cr*(cr+2));
if p(1)=='2' && p(6)=='2'
if ~ismember(str2double(p),had)
had(end+1)=str2double(p);
disp([str2double(p) cr-2 cr cr+2])
end
end
end
end
finds
product the consecutive even integers
287232 64 66 68
|
Posted by Charlie
on 2025-05-09 12:06:48 |