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.

A373630 a(n) is the n-th semiprime after the n-th prime.

Original entry on oeis.org

4, 6, 10, 15, 25, 26, 35, 38, 49, 57, 58, 74, 85, 86, 91, 95, 118, 119, 123, 133, 134, 143, 146, 161, 183, 185, 187, 201, 202, 205, 218, 221, 237, 247, 265, 267, 278, 295, 299, 302, 309, 314, 326, 327, 334, 335, 362, 393, 395, 398, 403, 413, 415, 427, 446, 453, 466, 469, 473, 481, 482, 497, 519
Offset: 1

Views

Author

Zak Seidov and Robert Israel, Jun 11 2024

Keywords

Examples

			a(5) = 25 because the 5th prime is 11 and the first 5 semiprimes > 11 are 14,15,21,22,25.
		

Crossrefs

Programs

  • Maple
    N:= 10^4: # for terms <= N
    P:= select(isprime,[2,seq(i,i=3..N,2)]):
    S:= select(t -> numtheory:-bigomega(t)=2, [$1..N]): nS:= nops(S):
    f:= proc(n) local j;
      j:= ListTools:-BinaryPlace(S,P[n]);
      if j + n <= nS then S[j+n] else fail fi
    end proc:
    R:= NULL:
    for i from 1 do
      v:= f(i);
      if v = fail then break fi;
      R:= R,v
    od:
    R;
  • Mathematica
    seq={};Do[i=Prime[n]+1;cnt=0;While[cntJames C. McMahon, Jun 15 2024 *)
  • Python
    from math import isqrt
    from sympy import primepi, prime
    def A373630(n):
        p = prime(n)
        q = n+int(sum(primepi(p//prime(k))-k+1 for k in range(1,primepi(isqrt(p))+1)))
        def f(x): return int(q+x-sum(primepi(x//prime(k))-k+1 for k in range(1, primepi(isqrt(x))+1)))
        m, k = q, f(q)
        while m != k:
            m, k = k, f(k)
        return m # Chai Wah Wu, Jul 23 2024

Formula

a(n) = A001358(n + A072000(A000040(n))).