Find the smallest integer N such that N+1 is a prime, N+2 is the product of 2 primes, N+3 is the product of 3 primes, N+4 is the product of 4 primes and N+5 is the product of 5 primes.
clearvars
seq=[length(factor(2)) length(factor(2)) length(factor(3)) length(factor(4)) length(factor(5))];
found=false; n=6;
while ~found
seq=[seq(2:end) length(factor(n))];
if isequal(seq,[1 2 3 4 5])
disp(n-5)
found=true;
n=n-5;
break
end
n=n+1;
end
for i=1:5
disp([n+i factor(n+i)])
end
n+... prime factors
15120
15121 15121
15122 2 7561
15123 3 71 71
15124 2 2 19 199
15125 5 5 5 11 11
|
Posted by Charlie
on 2024-05-30 22:51:49 |