OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(3) = 20 is a term because 20=2^2*5 with 2 <= 5.
MAPLE
N:= 3000: # for terms <= N
P:= select(isprime, [2, seq(i, i=3..N/2, 2)]): nP:= nops(P):
R:= NULL:
for i from 1 to nP do
p2:= P[i]^2;
for j from i to nP do
x:= p2*P[j];
if x > N then break fi;
R:= R, x
od od:
sort([R]);
PROG
(Python)
from sympy import primepi, primerange, integer_nthroot
def A337877(n):
def f(x): return int(n+x-sum(primepi(x//k**2)-a for a, k in enumerate(primerange(integer_nthroot(x, 3)[0]+1))))
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
return bisection(f) # Chai Wah Wu, Aug 29 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert Israel, Sep 27 2020
STATUS
approved