OFFSET
1,1
LINKS
Gabriel Whigham, Table of n, a(n) for n = 1..10000
EXAMPLE
31 is a term because (25 + 33 + 35)/3 = 31 is prime.
41 is a term because (35 + 39 + 49)/3 = 41 is prime.
MAPLE
OP:= select(isprime, [seq(i, i=3..10000, 2)]):
OSP:= sort(select(`<=`, [seq(seq(OP[i]*OP[j], j=1..i), i=1..nops(OP))], 3*OP[-1])):
SA:= [seq(add(OSP[i+j], j=0..2)/3, i=1..nops(OSP)-2)]:
select(t -> t::integer and isprime(t), SA); # Robert Israel, May 22 2023
MATHEMATICA
Select[Plus @@@ Partition[Select[Range[1, 3400, 2], PrimeOmega[#] == 2 &], 3, 1] / 3, 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, 21]
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(), 53))) # Michael S. Branicky, May 21 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Elmo R. Oliveira, May 20 2023
STATUS
approved
