login
A354791
Indices of nonprime terms in A354790.
5
1, 7, 14, 15, 17, 29, 31, 35, 59, 63, 64, 71, 79, 119, 120, 127, 129, 143, 159, 223, 239, 241, 255, 259, 260, 287, 288, 319, 320, 447, 479, 483, 484, 511, 512, 519, 521, 575, 577, 639, 641, 895, 959, 960, 967, 968, 969, 1023, 1025, 1039, 1043, 1044, 1151, 1152
OFFSET
1,2
LINKS
Rémy Sigrist, C program
PROG
(Python)
from math import lcm, gcd
from itertools import count, islice
from collections import deque
from sympy import factorint
def A354791_gen(): # generator of terms
aset, aqueue, c, b, f, i = {1}, deque([1]), 2, 1, True, 1
yield 1
while True:
for m in count(c):
if m not in aset and gcd(m, b) == 1 and all(map(lambda n:n<=1, fs:=factorint(m).values())):
i += 1
if len(fs) > 1:
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
A354791_list = list(islice(A354791_gen(), 30)) # Chai Wah Wu, Jul 17 2022
(C) See Links section.
CROSSREFS
Sequence in context: A232877 A232860 A232797 * A107976 A022557 A307546
KEYWORD
nonn
AUTHOR
EXTENSIONS
More terms from Rémy Sigrist, Jul 17 2022
STATUS
approved