OFFSET
1,1
EXAMPLE
23 is a term because (21 + 25)/2 = 23 is prime.
29 is a term because (25 + 33)/2 = 29 is prime.
MATHEMATICA
Select[Plus @@@ Partition[Select[Range[1, 1410, 2], PrimeOmega[#] == 2 &], 2, 1] / 2, PrimeQ] (* Amiram Eldar, May 21 2023 *)
PROG
(Python)
from itertools import count, islice
from sympy import factorint, isprime
def semiprime(n): return sum(e for e in factorint(n).values()) == 2
def nextoddsemiprime(n): return next(k for k in count(n+1+(n&1), 2) if semiprime(k))
def agen(): # generator of terms
osp = [9, 15]
while True:
q, r = divmod(sum(osp), len(osp))
if r == 0 and isprime(q):
yield q
osp = osp[1:] + [nextoddsemiprime(osp[-1])]
print(list(islice(agen(), 59))) # Michael S. Branicky, May 21 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Elmo R. Oliveira, May 20 2023
STATUS
approved