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.

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

Original entry on oeis.org

1, 2, 5, 3, 4, 6, 7, 12, 13, 8, 14, 9, 10, 15, 16, 11, 17, 31, 18, 19, 32, 20, 21, 33, 34, 35, 22, 23, 36, 37, 24, 25, 38, 26, 39, 27, 40, 28, 29, 41, 30, 42, 73, 43, 44, 74, 75, 76, 77, 45, 46, 78, 47, 79, 48, 80, 49, 81, 50, 51, 82, 52, 83, 84, 53, 54, 85
Offset: 1

Views

Author

Robert C. Lyons, Jan 05 2025

Keywords

Crossrefs

Cf. A379899.

Programs

  • Python
    from sympy import prime, primefactors, primepi
    def get_a379900(a379899_indices):
        a379900 = []
        count = 1
        while True:
            p = prime(count)
            if p not in a379899_indices:
                break
            a379900.append(a379899_indices[p])
            count += 1
        return a379900
    a379899 = [2]
    a379899_indices = dict()
    a379899_indices[2] = 1
    max_a379899_len=1000
    while len(a379899) <= max_a379899_len:
        candidate = a379899[-1]
        done = False
        while not done:
            candidate = candidate + 4
            factors = primefactors(candidate)
            for factor in factors:
                if factor not in a379899_indices:
                    a379899.append(factor)
                    a379899_indices[factor] = len(a379899)
                    done = True
                    break
    a379900 = get_a379900(a379899_indices)
    print(a379900)