OFFSET
1,1
EXAMPLE
For n = 5, there are at most 4 semiprimes in 5 consecutive numbers (because at least one of the 5 is divisible by 4). In the 5 consecutive numbers starting at 91 there are 4 semiprimes: 91 = 7 * 13, 93 = 3 * 31, 94 = 2 * 47 and 95 = 5 * 19, and no semiprime < 91 works, so a(5) = 91.
MAPLE
f:= proc(n)
local P, r, T, M, v, t, V, W, m, Ts, k, x, L, p, i;
P:= map(p -> `if`(p^2 <= n, p^2, p), select(isprime, [$1..n/2]));
r:= ilcm(P);
T:= combinat:-cartprod([seq([$0..p-1], p=P)]);
M:= 0;
while not T[finished] do
v:= T[nextvalue]();
t:= chrem(v, P);
V:= [seq(igcd(t+i, r), i=0..n-1)];
if V[1] <> 1 and not isprime(V[1]) then next fi;
W[t]:= select(i -> V[i] = 1 or isprime(V[i]), [$1..n]);
m:= nops(W[t]);
if m > M then
M:= m; Ts:= {t};
elif m = M then Ts:= Ts union {t}
fi
od:
for k from 0 do
for v in Ts do
x:= k*r + v;
L:= W[v] +~ (x-1);
if andmap(t -> numtheory:-bigomega(t) = 2, L) then return x fi;
od;
od:
end proc:
4, 9, 33, seq(f(n), n=4..17);
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Robert Israel, Jan 02 2024
STATUS
approved