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.

A377702 Perfect-powers except for powers of 2.

Original entry on oeis.org

9, 25, 27, 36, 49, 81, 100, 121, 125, 144, 169, 196, 216, 225, 243, 289, 324, 343, 361, 400, 441, 484, 529, 576, 625, 676, 729, 784, 841, 900, 961, 1000, 1089, 1156, 1225, 1296, 1331, 1369, 1444, 1521, 1600, 1681, 1728, 1764, 1849, 1936, 2025, 2116, 2187, 2197
Offset: 1

Views

Author

Gus Wiseman, Nov 05 2024

Keywords

Comments

Perfect-powers (A001597) are numbers with a proper integer root, complement A007916.

Examples

			The terms together with their prime indices begin:
     9: {2,2}
    25: {3,3}
    27: {2,2,2}
    36: {1,1,2,2}
    49: {4,4}
    81: {2,2,2,2}
   100: {1,1,3,3}
   121: {5,5}
   125: {3,3,3}
   144: {1,1,1,1,2,2}
   169: {6,6}
   196: {1,1,4,4}
   216: {1,1,1,2,2,2}
   225: {2,2,3,3}
   243: {2,2,2,2,2}
   289: {7,7}
   324: {1,1,2,2,2,2}
		

Crossrefs

Including the powers of 2 gives A001597, counted by A377435.
For prime-powers we have A061345.
These terms are counted by A377467, for non-perfect-powers A377701.
A000961 lists the powers of primes, differences A057820.
A001597 lists the perfect-powers, differences A053289, seconds A376559.
A007916 lists the non-perfect-powers, differences A375706, seconds A376562.
A081676 gives the greatest perfect-power <= n.
A131605 lists perfect-powers that are not prime-powers.
A188951 counts perfect-powers less than 2^n.
A377468 gives the least perfect-power > n.

Programs

  • Mathematica
    Select[Range[1000],GCD@@FactorInteger[#][[All,2]]>1&&!IntegerQ[Log[2,#]]&]
  • Python
    from sympy import mobius, integer_nthroot
    def A377702(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x): return int(n-2+x+(l:=x.bit_length())+sum(mobius(k)*(integer_nthroot(x,k)[0]-1) for k in range(2,l)))
        return bisection(f,n+1,n+1) # Chai Wah Wu, Nov 06 2024