OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(3) = 25 is a member because 25 = 5*5 and 25+5+5 = 5*7 is also a semiprime.
MAPLE
N:= 1000:
Primes:= select(isprime, [2, seq(i, i=3..N)]):
SP:= sort([seq(seq([p, q], q=select(t -> t >= p and p*t<=N, Primes)), p=Primes)], (a, b) -> a[1]*a[2]<b[1]*b[2]):
map(t -> t[1]*t[2], select(t -> numtheory:-bigomega(t[1]*t[2]+t[1]+t[2])=2, SP));
MATHEMATICA
Select[Union@ Apply[Join, Table[Flatten@{p #, Sort[{p, #}]} & /@ Prime@ Range@ PrimePi@ Floor[Max[#]/p], {p, #}]] &@ Prime@ Range@ 97, PrimeOmega[Total@ #] == 2 &][[All, 1]] (* Michael De Vlieger, Dec 15 2019 *)
PROG
(PARI) issemi(n)=bigomega(n)==2
list(lim)=my(v=List()); forprime(p=2, sqrtint(lim\=1), forprime(q=p, lim\p, if(issemi(p*q+p+q), listput(v, p*q)))); Set(v) \\ Charles R Greathouse IV, Dec 16 2019
(Python)
from sympy import factorint
def is_semiprime(n): return sum(e for e in factorint(n).values()) == 2
def ok(n):
f = factorint(n, multiple=True)
if len(f) != 2: return False
p, q = f
return len(factorint(p*q + p + q, multiple=True)) == 2
print(list(filter(ok, range(506)))) # Michael S. Branicky, Sep 22 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
J. M. Bergot and Robert Israel, Dec 15 2019
STATUS
approved