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.

A379776 a(n) = position of prime(n) in A379775, or a(n) = -1 if prime(n) is not in A379775.

Original entry on oeis.org

1, 2, 3, 6, 5, 7, 4, 12, 25, 11, 20, 13, 40, 33, 43, 45, 27, 21, 44, 42, 14, 48, 71, 26, 8, 72, 64, 41, 112, 23, 116, 82, 111, 46, 62, 53, 49, 152, 80, 75, 37, 262, 122, 9, 99, 93, 38, 115, 52, 343, 28, 286, 22, 162, 104, 274, 36, 87, 47, 70, 171, 79, 18, 140
Offset: 1

Views

Author

Robert C. Lyons, Jan 02 2025

Keywords

Crossrefs

Cf. A379775.

Programs

  • Python
    from sympy import prime, primefactors, primepi
    def get_a379776(a379775_indices):
        a379776 = []
        count = 1
        while True:
            p = prime(count)
            if p not in a379775_indices:
                break
            a379776.append(a379775_indices[p])
            count += 1
        return a379776
    a379775 = [2]
    a379775_indices = dict()
    a379775_indices[2] = 1
    max_a379775_len=1000
    while len(a379775) <= max_a379775_len:
        candidate = a379775[-1]
        done = False
        while not done:
            candidate = 2*candidate - 1
            factors = primefactors(candidate)
            for factor in factors:
                if factor not in a379775_indices:
                    a379775.append(factor)
                    a379775_indices[factor] = len(a379775)
                    done = True
                    break
    a379776 = get_a379776(a379775_indices)
    print(a379776)