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.

A376200 Indices where primes appear in A376198.

Original entry on oeis.org

2, 3, 9, 10, 11, 23, 24, 25, 26, 52, 53, 54, 55, 56, 57, 58, 59, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488
Offset: 1

Views

Author

N. J. A. Sloane, Oct 03 2024

Keywords

Comments

The primes appear in order, so a(n) is also the index of prime(n) in A376198.

Crossrefs

Programs

  • Python
    from itertools import count, islice
    from sympy import isprime, nextprime
    def agen(): # generator of terms
        an, smc, smp = 2, 4, 3
        for n in count(2):
            if not isprime(an):
                an = smp if an == 2*smp else smc
            else:
                yield n
                an = smp if smp < smc else smc
            if an == smp: smp = nextprime(smp)
            else:
                smc += 1
                while isprime(smc): smc += 1
    print(list(islice(agen(), 71))) # Michael S. Branicky, Oct 03 2024