N is a positive integer with the following properties.
- N and N+2 are both composite, and the smallest prime that divides either N or N+2 is P.
- For any positive integer M<N such that M and M+2 are both composite, either M or M+2 is divisible by some prime less than P.
- N+6 and N+8 are both composite, and the smallest prime that divides either N+6 or N+8 is greater than P.
What is N?
clc,clearvars
largest=0;
for n=1:20000
f1=factor(n);
if length(f1)>1
f2=factor(n+2);
if length(f2)>1
p=min(union(f1,f2));
if p>largest
largest=p;
f3=factor(n+6);
if length(f3)>1
f4=factor(n+8);
if length(f4)>1
p2=min(union(f3,f4));
if p2>p
disp(n)
end
end
end
end
end
end
end
finds
4181
The respective prime factorizations of 4181, 4183, 4187 and 4189 are:
37 * 113
47 * 89
53 * 79
59 * 71
|
Posted by Charlie
on 2024-11-06 11:39:25 |