OFFSET
1,1
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..2517
PROG
(Python)
from itertools import count, islice
from collections import deque
from math import gcd, lcm
from sympy import factorint
def A354161_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 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