cp's OEIS Frontend

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.

A097054 Nonsquare perfect powers.

This page as a plain text file.
%I A097054 #37 Feb 16 2025 08:32:54
%S A097054 8,27,32,125,128,216,243,343,512,1000,1331,1728,2048,2187,2197,2744,
%T A097054 3125,3375,4913,5832,6859,7776,8000,8192,9261,10648,12167,13824,16807,
%U A097054 17576,19683,21952,24389,27000,29791,32768,35937,39304,42875,50653
%N A097054 Nonsquare perfect powers.
%C A097054 Terms of A001597 that are not in A000290.
%C A097054 All terms of this sequence are also in A070265 (odd powers), but omitting those odd powers that are also a square (e.g. 64=4^3=8^2).
%H A097054 Reinhard Zumkeller, <a href="/A097054/b097054.txt">Table of n, a(n) for n = 1..10000</a>
%H A097054 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PerfectPower.html">Perfect Power</a>.
%H A097054 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/OddPower.html">Odd Power</a>.
%F A097054 A052409(a(n)) is odd. - _Reinhard Zumkeller_, Mar 28 2014
%F A097054 Sum_{n>=1} 1/a(n) = 1 - zeta(2) + Sum_{k>=2} mu(k)*(1-zeta(k)) = 0.2295303015... - _Amiram Eldar_, Dec 21 2020
%p A097054 # uses code of A001597
%p A097054 for n from 4 do
%p A097054     if not issqr(n) and isA001597(n) then
%p A097054         printf("%d,\n",n);
%p A097054     end if;
%p A097054 end do: # _R. J. Mathar_, Jan 13 2021
%t A097054 nn = 50653; Select[Union[Flatten[Table[n^i, {i, Prime[Range[2, PrimePi[Log[2, nn]]]]}, {n, 2, nn^(1/i)}]]], ! IntegerQ[Sqrt[#]] &] (* _T. D. Noe_, Apr 19 2011 *)
%o A097054 (Haskell)
%o A097054 import Data.Map (singleton, findMin, deleteMin, insert)
%o A097054 a097054 n = a097054_list !! (n-1)
%o A097054 a097054_list = f 9 (3, 2) (singleton 4 (2, 2)) where
%o A097054    f zz (bz, be) m
%o A097054     | xx < zz && even be =
%o A097054                 f zz (bz, be+1) (insert (bx*xx) (bx, be+1) $ deleteMin m)
%o A097054     | xx < zz = xx :
%o A097054                 f zz (bz, be+1) (insert (bx*xx) (bx, be+1) $ deleteMin m)
%o A097054     | xx > zz = f (zz+2*bz+1) (bz+1, 2) (insert (bz*zz) (bz, 3) m)
%o A097054     | otherwise = f (zz + 2 * bz + 1) (bz + 1, 2) m
%o A097054     where (xx, (bx, be)) = findMin m
%o A097054 -- _Reinhard Zumkeller_, Mar 28 2014
%o A097054 (PARI) is(n)=ispower(n)%2 \\ _Charles R Greathouse IV_, Aug 28 2016
%o A097054 (PARI) list(lim)=my(v=List()); forprime(e=3,logint(lim\=1,2), for(b=2,sqrtnint(lim,e), if(!issquare(b), listput(v,b^e)))); Set(v) \\ _Charles R Greathouse IV_, Jan 09 2023
%o A097054 (Python)
%o A097054 from sympy import mobius, integer_nthroot
%o A097054 def A097054(n):
%o A097054     def f(x): return int(n-1+x+sum(mobius(k)*(integer_nthroot(x,k)[0]-1) for k in range(3,x.bit_length())))
%o A097054     kmin, kmax = 1,2
%o A097054     while f(kmax) >= kmax:
%o A097054         kmax <<= 1
%o A097054     while True:
%o A097054         kmid = kmax+kmin>>1
%o A097054         if f(kmid) < kmid:
%o A097054             kmax = kmid
%o A097054         else:
%o A097054             kmin = kmid
%o A097054         if kmax-kmin <= 1:
%o A097054             break
%o A097054     return kmax # _Chai Wah Wu_, Aug 14 2024
%Y A097054 Cf. A001597 (perfect powers), A000290 (the squares), A008683, A070265 (odd powers), A097055, A097056, A239870, A239728, A093771.
%K A097054 nonn,easy
%O A097054 1,1
%A A097054 _Hugo Pfoertner_, Jul 21 2004