OFFSET
0,1
MAPLE
P:=[seq(ithprime(n), n=1..100)]: B:={seq(seq(P[i]*P[j], j=1..100), i=1..100)}:C:={seq(B[k], k=1..140)}: seq(C[2*j-1], j=1..70); # Emeric Deutsch, Dec 14 2004
PROG
(Python)
from math import isqrt
from sympy import primepi, primerange
def A099980(n):
def bisection(f, kmin=0, kmax=1):
while f(kmax) > kmax: 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((n<<1)+1+x+((t:=primepi(s:=isqrt(x)))*(t-1)>>1)-sum(primepi(x//p) for p in primerange(s+1)))
return bisection(f, (n<<1)+1, (n<<1)+1) # Chai Wah Wu, Oct 23 2024
CROSSREFS
KEYWORD
nonn,easy,changed
AUTHOR
N. J. A. Sloane, Nov 19 2004
EXTENSIONS
More terms from Emeric Deutsch, Dec 14 2004
STATUS
approved