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.

A377994 Numbers k such that k + PrimePi(k) is odd.

Original entry on oeis.org

1, 2, 3, 6, 7, 9, 12, 13, 15, 18, 19, 21, 24, 26, 28, 29, 32, 34, 36, 37, 39, 42, 43, 45, 48, 50, 52, 53, 55, 57, 60, 61, 63, 65, 68, 70, 71, 74, 76, 78, 79, 81, 84, 86, 88, 89, 91, 93, 95, 98, 100, 101, 104, 106, 107, 110, 112, 113, 115, 117, 119, 121, 123, 125
Offset: 1

Views

Author

Paolo Xausa, Nov 13 2024

Keywords

Crossrefs

Complement of A377897.
Cf. A000720.

Programs

  • Mathematica
    Select[Range[200], OddQ[# + PrimePi[#]] &]
  • Python
    from sympy import prevprime, primepi
    def A377994(n):
        def f(x):
            if x<=3: return n
            p = prevprime(x+1)
            i = int(primepi(p))
            return n+(p>>1)+(x-p-((i^x)&1)>>1)
        m, k = n, f(n)
        while m != k: m, k = k, f(k)
        return m # Chai Wah Wu, Nov 13 2024
    
  • Python
    from sympy import nextprime
    def A377994_gen(): # generator of terms
        p,q,a = 3,5,0
        yield from (1,2)
        while True:
            yield from range(p+a,q,2)
            p, q, a = q, nextprime(q), a^1
    A377994_list = list(islice(A377994_gen(),40)) # Chai Wah Wu, Nov 13 2024