|
|
A075308
|
|
Number of n-digit perfect powers.
|
|
11
|
|
|
4, 8, 28, 84, 242, 744, 2284, 7096, 22179, 69561, 218759, 689206, 2173942, 6862783, 21676671, 68493153, 216477260, 684309327, 2163434093, 6840212693, 21628140126, 68388775913, 216252650605, 683825838922, 2162393136881, 6837971108286, 21623312527390, 68378377967873
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
a(2) = 8 because there are eight 2-digit perfect powers: 16, 25, 27, 32, 36, 49, 64, 81.
|
|
PROG
|
(Python)
from sympy import mobius, integer_nthroot
def A075308(n): return int(sum(mobius(x)*(integer_nthroot(10**(n-1), x)[0]-integer_nthroot(10**n, x)[0]) for x in range(2, ((10**(n-1)).bit_length())))-sum(mobius(x)*(integer_nthroot(10**n, x)[0]-1) for x in range((10**(n-1)).bit_length(), (10**n).bit_length()))) if n>2 else n<<2 # Chai Wah Wu, Aug 13 2024
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base,easy,changed
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|