OFFSET
1,4
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
PROG
(Haskell)
a072776 n = a072776_list !! (n-1) -- a072776_list defined in A072774.
-- Reinhard Zumkeller, Apr 06 2014
(Python)
from math import isqrt
from sympy import mobius, integer_nthroot, perfect_power
def A072776(n):
def g(x): return int(sum(mobius(k)*(x//k**2) for k in range(1, isqrt(x)+1)))-1
def f(x): return n-2+x-sum(g(integer_nthroot(x, k)[0]) for k in range(1, x.bit_length()))
kmin, kmax = 1, 2
while f(kmax) >= kmax:
kmax <<= 1
while True:
kmid = kmax+kmin>>1
if f(kmid) < kmid:
kmax = kmid
else:
kmin = kmid
if kmax-kmin <= 1:
break
return 1 if not (p:=perfect_power(kmax)) else p[1] # Chai Wah Wu, Aug 19 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Jul 10 2002
STATUS
approved