reviewed
approved
reviewed
approved
proposed
reviewed
editing
proposed
return bisection(f, n, n) # Chai Wah Wu, Sep 12 2024
(Python)
from sympy import primepi, integer_nthroot, primerange
def A036454(n):
def f(x): return int(n+x-sum(primepi(integer_nthroot(x, p-1)[0]) for p in primerange(3, x.bit_length()+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, n, n) # Chai Wah Wu, Sep 12 2024
approved
editing
reviewed
approved
proposed
reviewed
editing
proposed
Sum_{n>=1} 1/a(n) = Sum_{k>=2} P(prime(k)-1) = 0.54756961912815344341..., where P is the prime zeta function. - Amiram Eldar, Jul 10 2022
approved
editing
reviewed
approved