OFFSET
1,1
COMMENTS
The first non-semiprime terms are 114, 130, 174, 186, ... . What is the smallest term with more than 3 prime factors?
First term with 4 prime factors is a(189) = 690. First term with 5 prime factors is a(2625) = 6510. - Chai Wah Wu, Sep 24 2025
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..10000
PROG
(Python)
from math import prod
from itertools import count, islice
from sympy import factorint, integer_nthroot, isprime
def A389138_gen(): # generator of terms
g, p, r = [set()], 0, {}
for c in count(2):
f = factorint(c)
d = g[-1]^set(i for i, j in f.items() if j&1)
for h in g:
if (t:=prod(d^h)) not in r:
r[t] = c-1
g.append(d)
x, y = integer_nthroot(c, 2)
if c>4 and y and isprime(x):
continue
elif c>4 and max(f.values())>1:
continue
else:
flag = False
for b in range(c-2, p, -1):
e = prod(d^g[b])
if e in r and r[e]<b:
flag = True
break
if flag:
continue
if isprime(c):
p = c-2
else:
yield c
CROSSREFS
KEYWORD
nonn
AUTHOR
Hugo Pfoertner, Sep 24 2025
STATUS
approved
