OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..1000
EXAMPLE
a(3)=4174=2*2087, the next semiprime is 4178=2*2089, and 4174+2+2087=6263 and 4178+2+2089=6269 are consecutive primes.
MAPLE
g:= proc(n) local F;
F:= ifactors(n)[2];
if nops(F)=2 then n+F[1][1]+F[2][1] else n+2*F[1][1] fi
end proc:
SP:= select(t -> numtheory:-bigomega(t)=2, [seq(i, i=4..3*10^5)]):
nSP:= nops(SP):
P1:= map(g, SP):
SP[select(t -> isprime(P1[t]) and nextprime(P1[t])=P1[t+1], [$1..nSP-1])];
MATHEMATICA
Select[Partition[Union@ Apply[Join, Table[Flatten@ {p #, Sort[{p, #}]} & /@ Prime@ Range@ PrimePi@ Floor[Max[#]/p], {p, #}]] &@ Prime@ Range[3*10^4], 2, 1], And[AllTrue[{#1, #2}, PrimeQ], #2 == NextPrime@ #1] & @@ {Total@ #1, Total@ #2} & @@ # &][[All, 1, 1]] (* Michael De Vlieger, Dec 15 2019 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
J. M. Bergot and Robert Israel, Dec 15 2019
STATUS
approved