OFFSET
1,1
PROG
(Python)
from itertools import count, islice
from collections import deque
from math import gcd, lcm
from sympy import factorint
def A354163_gen(): # generator of terms
aset, aqueue, c, b, f, i = {1}, deque([1]), 2, 1, True, 1
while True:
for m in count(c):
if m not in aset and gcd(m, b) == 1:
i += 1
if m % 2 and len(fm := factorint(m)) == sum(fm.values()) == 2:
yield i
aset.add(m)
aqueue.append(m)
if f: aqueue.popleft()
b = lcm(*aqueue)
f = not f
while c in aset:
c += 1
break
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, May 30 2022
STATUS
approved