OFFSET
1,1
COMMENTS
If n == 0 (mod 3) then a(n) == 1 or 5 (mod 6).
If n == 1 (mod 3) then a(n) == 3 or 5 (mod 6).
If n == 2 (mod 3) then a(n) == 1 or 3 (mod 6).
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(3) = 25 because 25 = 5^2 is a semiprime and 25 - 2*3 = 19 and 25 + 2*3 = 31 are primes, and 25 is the least semiprime that works.
MAPLE
f:= proc(n) local p;
p:= 1:
do
p:= nextprime(p);
if isprime(p+4*n) and numtheory:-bigomega(p+2*n) = 2 then return p+2*n fi
od
end proc:
map(f, [$1..100]);
PROG
(PARI) a(n) = my(x=2*n+2); while ((bigomega(x)!=2) || !isprime(x-2*n) || !isprime(x+2*n), x++); x; \\ Michel Marcus, Oct 31 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
J. M. Bergot and Robert Israel, Oct 30 2022
STATUS
approved