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.

A384940 Odd semiprimes interleaved with even semiprimes.

Original entry on oeis.org

9, 4, 15, 6, 21, 10, 25, 14, 33, 22, 35, 26, 39, 34, 49, 38, 51, 46, 55, 58, 57, 62, 65, 74, 69, 82, 77, 86, 85, 94, 87, 106, 91, 118, 93, 122, 95, 134, 111, 142, 115, 146, 119, 158, 121, 166, 123, 178, 129, 194, 133, 202, 141, 206, 143, 214, 145, 218, 155, 226, 159, 254, 161, 262, 169, 274, 177
Offset: 1

Views

Author

Zak Seidov and Robert Israel, Jun 13 2025

Keywords

Examples

			a(3) = A046315(2) = 15 is the second odd semiprime.
a(4) = A100484(2) = 6 is the second even semiprime.
		

Crossrefs

Programs

  • Maple
    A:= select(t -> numtheory:-bigomega(t)=2, [seq(i,i=1..1000,2)]):
    B:= select(t -> numtheory:-bigomega(t)=2, [seq(i,i=2..1000,2)]):
    seq(op([A[i],B[i]]),i=1..min(nops(A),nops(B)));
  • Python
    from math import isqrt
    from sympy import primepi, primerange, prime
    def A384940(n):
        if n&1:
            m = n+1>>1
            def bisection(f,kmin=0,kmax=1):
                while f(kmax) > kmax: kmax <<= 1
                kmin = kmax >> 1		
                while kmax-kmin > 1:
                    kmid = kmax+kmin>>1
                    if f(kmid) <= kmid:
                        kmax = kmid
                    else:
                        kmin = kmid
                return kmax
            def f(x): return int(m+x+((t:=primepi(s:=isqrt(x)))*(t-1)>>1)-sum(primepi(x//k) for k in primerange(3, s+1)))
            return bisection(f,m,m)
        else:
            return prime(n>>1)<<1 # Chai Wah Wu, Jun 17 2025

Formula

a(2*k-1) = A046315(k).
a(2*k) = A100484(k).