login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A377468
Least perfect-power >= n.
34
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,2
COMMENTS
Perfect-powers (A001597) are numbers with a proper integer root, complement A007916.
FORMULA
Positions of first appearances for n > 2 are A216765(n-2) = A001597(n-1) + 1.
MATHEMATICA
perpowQ[n_]:=n==1||GCD@@FactorInteger[n][[All, 2]]>1;
Table[NestWhile[#+1&, n, #>1&&!perpowQ[#]&], {n, 100}]
PROG
(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
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.
Sequence in context: A105352 A132200 A110757 * A167184 A276113 A232406
KEYWORD
nonn
AUTHOR
Gus Wiseman, Nov 05 2024
STATUS
approved