OFFSET
1,1
EXAMPLE
11^2=121 and 5^3=125 are members with index 8 and 9 in A053810. So a(8)=125-121=4.
PROG
(Python)
from sympy import primepi, integer_nthroot, primerange
def A062780(n):
def f(x): return int(n+x-sum(primepi(integer_nthroot(x, p)[0]) for p in primerange(x.bit_length())))
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 -(a:=bisection(f, n, n))+bisection(lambda x:f(x)+1, a, a) # Chai Wah Wu, Sep 12 2024
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Rainer Rosenthal, Jul 18 2001
EXTENSIONS
Edited and extended by Ray Chandler, Oct 30 2008
STATUS
approved