OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(5) = 25 because the 5th prime is 11 and the first 5 semiprimes > 11 are 14,15,21,22,25.
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[cnt<n, If[PrimeOmega[i]==2, cnt++]; i++]; AppendTo[seq, i-1], {n, 63}]; seq (* James C. McMahon, Jun 15 2024 *)
PROG
(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
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov and Robert Israel, Jun 11 2024
STATUS
approved