login
Number of n-digit perfect powers.
11

%I #21 Aug 13 2024 11:21:02

%S 4,8,28,84,242,744,2284,7096,22179,69561,218759,689206,2173942,

%T 6862783,21676671,68493153,216477260,684309327,2163434093,6840212693,

%U 21628140126,68388775913,216252650605,683825838922,2162393136881,6837971108286,21623312527390,68378377967873

%N Number of n-digit perfect powers.

%F a(n) = A070428(n) - A070428(n-1) for n >= 3.

%e a(2) = 8 because there are eight 2-digit perfect powers: 16, 25, 27, 32, 36, 49, 64, 81.

%e a(3) = 28 = A070428(3) - A070428(2) = 41 - 13 (in A070428 offset is 0).

%o (Python)

%o from sympy import mobius, integer_nthroot

%o 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

%Y Cf. A001597, A070428.

%K nonn,base,easy

%O 1,1

%A _Zak Seidov_, Oct 11 2002

%E More terms from _Jinyuan Wang_, Mar 02 2020