OFFSET
2,1
COMMENTS
LINKS
Robert Israel, Table of n, a(n) for n = 2..10000
EXAMPLE
The 5th semiprime is 14, A373887(5) = 3, and there are two arithmetic progressions of semiprimes of length 3 ending in 14, namely 6, 10, 14 with common difference 4 and 4, 9, 14 with common difference 5. Therefore a(5) = min(4, 5) = 4.
MAPLE
S:= select(t -> numtheory:-bigomega(t)=2, [$1..10^5]):
f:= proc(n) local s, i, m, d, j, dm;
m:= 1;
s:= S[n];
for i from n-1 to 1 by -1 do
d:= s - S[i];
if s - m*d < 4 then return dm fi;
for j from 2 while ListTools:-BinarySearch(S, s-j*d) <> 0 do od;
if j > m then m:= j; dm:= d fi;
od;
dm;
end proc:
map(f, [$2..200]);
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert Israel, Aug 18 2024
STATUS
approved