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.

A377468 Least perfect-power >= n.

Original entry on oeis.org

1, 4, 4, 4, 8, 8, 8, 8, 9, 16, 16, 16, 16, 16, 16, 16, 25, 25, 25, 25, 25, 25, 25, 25, 25, 27, 27, 32, 32, 32, 32, 32, 36, 36, 36, 36, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 81, 81, 81
Offset: 1

Views

Author

Gus Wiseman, Nov 05 2024

Keywords

Comments

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

Crossrefs

The version for prime-powers is A000015.
The union is A001597 (perfect-powers), without powers of two A377702.
Positions of last appearances are also A001597.
The version for primes is A007918 or A151800.
The version for squarefree numbers is A067535.
Run-lengths are A076412.
The opposite version (greatest perfect-power <= n) is A081676.
A000040 lists the primes, differences A001223.
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.
A069623 counts perfect-powers <= n.
A076411 counts perfect-powers < n.
A131605 lists perfect-powers that are not prime-powers.
A377432 counts perfect-powers between primes, zeros A377436.

Programs

  • Mathematica
    perpowQ[n_]:=n==1||GCD@@FactorInteger[n][[All,2]]>1;
    Table[NestWhile[#+1&,n,#>1&&!perpowQ[#]&],{n,100}]
  • Python
    from sympy import mobius, integer_nthroot
    def A377468(n):
        if n == 1: return 1
        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(x-1+sum(mobius(k)*(integer_nthroot(x,k)[0]-1) for k in range(2,x.bit_length())))
        m = n-f(n-1)
        return bisection(lambda x:f(x)+m,n-1,n) # Chai Wah Wu, Nov 05 2024

Formula

Positions of first appearances for n > 2 are A216765(n-2) = A001597(n-1) + 1.