This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A376120 #12 Oct 05 2024 03:38:30 %S A376120 1,8,9,36,128,225,441,625,1089,1521,2025,2601,3249,3600,4761,5625, %T A376120 6561,7569,7776,8100,8649,10000,12321,15129,16641,19881,21952,22500, %U A376120 25281,26244,28224,31329,32400,32768,33489,35721,40401,45369,47961,50625,56169,62001,64000,71289,84681,90000 %N A376120 Refactorable numbers that are perfect powers. %C A376120 Intersection of A001597 and A033950. %e A376120 8 is a perfect power, as 8=2^3, and it is also a refactorable numbers, being divisible by its number of divisors (4). %t A376120 Join[{1}, Select[Range[10^5], Divisible[#, DivisorSigma[0,#]]&&GCD@@FactorInteger[#][[All, 2]]>1&]] %o A376120 (PARI) ok(n) = n==1 || (n%numdiv(n)==0&&ispower(n)) %o A376120 (Python) %o A376120 from itertools import count, islice %o A376120 from math import prod %o A376120 from sympy import mobius, integer_nthroot, factorint %o A376120 def A376120_gen(): # generator of terms %o A376120 def bisection(f,kmin=0,kmax=1): %o A376120 while f(kmax) > kmax: kmax <<= 1 %o A376120 while kmax-kmin > 1: %o A376120 kmid = kmax+kmin>>1 %o A376120 if f(kmid) <= kmid: %o A376120 kmax = kmid %o A376120 else: %o A376120 kmin = kmid %o A376120 return kmax %o A376120 def f(x): return int(x-1+sum(mobius(k)*(integer_nthroot(x,k)[0]-1) for k in range(2,x.bit_length()))) %o A376120 m = 1 %o A376120 for n in count(1): %o A376120 m = bisection(lambda x:f(x)+n,m,m) %o A376120 if not m%prod(e+1 for e in factorint(m).values()): yield m %o A376120 A376120_list = list(islice(A376120_gen(),40)) # _Chai Wah Wu_, Oct 04 2024 %Y A376120 Cf. A001597 (perfect powers), A033950 (refactorable numbers). %K A376120 nonn %O A376120 1,2 %A A376120 _Waldemar Puszkarz_, Sep 11 2024