A377043 The n-th perfect-power A001597(n) minus the n-th power of a prime A000961(n).
0, 2, 5, 5, 11, 18, 19, 23, 25, 36, 48, 64, 81, 98, 100, 101, 115, 138, 164, 179, 184, 200, 209, 240, 271, 284, 300, 336, 374, 413, 439, 450, 495, 542, 587, 632, 683, 738, 793, 852, 887, 903, 964, 1029, 1097, 1165, 1194, 1230, 1295, 1370, 1443, 1518, 1561
Offset: 1
Keywords
Crossrefs
Excluding 1 from the powers of primes gives A377044.
A000015 gives the least prime-power >= n.
A031218 gives the greatest prime-power <= n.
A025475 lists numbers that are both a perfect-power and a prime-power.
A080101 counts prime-powers between primes (exclusive).
A106543 lists numbers that are neither a perfect-power nor a prime-power.
A131605 lists perfect-powers that are not prime-powers.
Programs
-
Mathematica
perpowQ[n_]:=n==1||GCD@@FactorInteger[n][[All,2]]>1; per=Select[Range[1000],perpowQ]; per-NestList[NestWhile[#+1&,#+1,!PrimePowerQ[#]&]&,1,Length[per]-1]
-
Python
from sympy import mobius, primepi, integer_nthroot def A377043(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-1+x+sum(mobius(k)*(integer_nthroot(x,k)[0]-1) for k in range(2,x.bit_length()))) def g(x): return int(n-1+x-sum(primepi(integer_nthroot(x,k)[0]) for k in range(1,x.bit_length()))) return bisection(f,n,n)-bisection(g,n,n) # Chai Wah Wu, Oct 27 2024
Comments