OFFSET
1,2
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
Eric Weisstein's World of Mathematics, Perfect Powers.
EXAMPLE
MATHEMATICA
ppQ[n_] := GCD @@ Last /@ FactorInteger@# > 1; f[n_] := Block[{fi = Transpose@ FactorInteger@ n}, fi2 = fi[[2]]; Times @@ (fi[[1]]^(fi[[2]] (1 + 1/GCD @@ fi[[2]])))]; lst = Join[{1}, Select[ Range@ 1848, ppQ@# &]]; f /@ lst (* Robert G. Wilson v, Aug 03 2008 *)
PROG
(Haskell)
a076405 n = a076405_list !! (n-1)
a076405_list = 1 : f (tail $ zip a001597_list a025478_list) where
f ((p, r) : us) = g us where
g ((q, r') : vs) = if r' == r then q : f us else g vs
-- Reinhard Zumkeller, Mar 11 2014
(Python)
from math import gcd
from sympy import mobius, integer_nthroot, factorint
def A076405(n):
if n == 1: return 1
def f(x): return int(n-2+x+sum(mobius(k)*(integer_nthroot(x, k)[0]-1) for k in range(2, 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 kmax*integer_nthroot(kmax, gcd(*factorint(kmax).values()))[0] # Chai Wah Wu, Aug 13 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Oct 09 2002
EXTENSIONS
More terms from Robert G. Wilson v, Aug 03 2008
STATUS
approved