Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #20 Aug 14 2024 01:55:38
%S 1,8,16,27,32,125,81,64,216,343,128,243,1000,1331,625,256,1728,2197,
%T 2744,1296,3375,729,512,4913,5832,2401,6859,8000,9261,10648,1024,
%U 12167,13824,3125,17576,2187,21952,24389,27000,29791,10000,2048,35937,39304
%N Next perfect power having the same least root of n-th perfect power, A001597.
%C A025478(a(n)) = A025478(n); A001597(a(n)) = A025478(n)*A001597(n).
%H Reinhard Zumkeller, <a href="/A076405/b076405.txt">Table of n, a(n) for n = 1..10000</a>
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/PerfectPower.html">Perfect Powers</a>.
%e . n | A001597(n) | A025478(n)^A025479(n) | a(n)
%e . -----+------------+-----------------------+---------------------------
%e . 13 | 100 | 10^2 | 1000 = 10^3 = A001597(41)
%e . 14 | 121 | 11^2 | 1331 = 11^3 = A001597(47)
%e . 15 | 125 | 5^3 | 625 = 5^4 = A001597(34)
%e . 16 | 128 | 2^7 | 256 = 2^8 = A001597(23)
%e . 17 | 144 | 12^2 | 1728 = 12^3 = A001597(54).
%t 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 *)
%o (Haskell)
%o a076405 n = a076405_list !! (n-1)
%o a076405_list = 1 : f (tail $ zip a001597_list a025478_list) where
%o f ((p, r) : us) = g us where
%o g ((q, r') : vs) = if r' == r then q : f us else g vs
%o -- _Reinhard Zumkeller_, Mar 11 2014
%o (Python)
%o from math import gcd
%o from sympy import mobius, integer_nthroot, factorint
%o def A076405(n):
%o if n == 1: return 1
%o 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())))
%o kmin, kmax = 1,2
%o while f(kmax) >= kmax:
%o kmax <<= 1
%o while True:
%o kmid = kmax+kmin>>1
%o if f(kmid) < kmid:
%o kmax = kmid
%o else:
%o kmin = kmid
%o if kmax-kmin <= 1:
%o break
%o return kmax*integer_nthroot(kmax, gcd(*factorint(kmax).values()))[0] # _Chai Wah Wu_, Aug 13 2024
%Y Cf. A052410.
%K nonn
%O 1,2
%A _Reinhard Zumkeller_, Oct 09 2002
%E More terms from _Robert G. Wilson v_, Aug 03 2008