OFFSET
0,3
COMMENTS
Non-perfect-powers (A007916) are numbers without a proper integer root.
Also the number of non-perfect-powers with n bits.
FORMULA
a(n) = 2^n-1-A377467(n). - Pontus von Brömssen, Nov 06 2024
EXAMPLE
The non-perfect-powers in each range (rows):
.
3
5 6 7
10 11 12 13 14 15
17 18 19 20 21 22 23 24 26 28 29 30 31
Their binary expansions (columns):
. 11 101 1010 10001
110 1011 10010
111 1100 10011
1101 10100
1110 10101
1111 10110
10111
11000
11010
11100
11101
11110
11111
MATHEMATICA
radQ[n_]:=n>1&&GCD@@Last/@FactorInteger[n]==1;
Table[Length[Select[Range[2^n+1, 2^(n+1)-1], radQ]], {n, 0, 15}]
PROG
(Python)
from sympy import mobius, integer_nthroot
def A377701(n):
def f(x): return int(x-1+sum(mobius(k)*(integer_nthroot(x, k)[0]-1) for k in range(2, x.bit_length())))
return f((1<<n+1)-1)-f((1<<n)) # Chai Wah Wu, Nov 06 2024
CROSSREFS
The union of all numbers counted is A007916.
For squarefree numbers we have A077643.
For prime-powers we have A244508.
A081676 gives the greatest perfect-power <= n.
A131605 lists perfect-powers that are not prime-powers.
A377468 gives the least perfect-power > n.
KEYWORD
nonn
AUTHOR
Gus Wiseman, Nov 05 2024
EXTENSIONS
Offset corrected by, and a(16)-a(33) from Pontus von Brömssen, Nov 06 2024
STATUS
approved