cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A354791 Indices of nonprime terms in A354790.

Original entry on oeis.org

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

Views

Author

Keywords

Crossrefs

Programs

  • C
    See Links section.
  • 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
    

Extensions

More terms from Rémy Sigrist, Jul 17 2022