%I #55 Aug 13 2024 11:21:06
%S 3,11,39,123,365,1109,3393,10489,32668,102229,320988,1010194,3184136,
%T 10046919,31723590,100216743,316694003,1001003330,3164437423,
%U 10004650116,31632790242,100021566155,316274216760,1000100055682,3162493192563,10000464300849,31623776828239,100002154796112
%N Total number of perfect powers > 1 below 10^n.
%C k is a perfect power <=> there exist integers a and b, b > 1, and k = a^b.
%C From _Robert G. Wilson v_, Jul 17 2016: (Start)
%C Limit_{n->oo} a(n)/sqrt(10^n) = 1.
%C A089580(n) - a(n) = A275358(n).
%C The four terms which make up the difference between A089580(2) - a(2) are: 16 = 2^4 = 4^2, 64 = 2^6 = 4^3 = 8^2 and 81 = 3^4 = 9^2; one for 16, two for 64 and one for 81 making a total of 4. See A117453.
%C (End)
%H Robert G. Wilson v, <a href="/A089579/b089579.txt">Table of n, a(n) for n = 1..100</a>
%F a(n) = A070428(n) - 2 for n >= 2.
%e For n=2, the 11 perfect powers > 1 below 10^2 = 100 are: 4, 8, 9, 16, 25, 27, 32, 36, 49, 64, 81. - _Michael B. Porter_, Jul 18 2016
%t Table[lim=10^n-1; Sum[ -(Floor[lim^(1/k)]-1)*MoebiusMu[k], {k,2,Floor[Log[2,lim]]}], {n,30}] (* _T. D. Noe_, Nov 16 2006 *)
%o (SageMath)
%o def A089579(n):
%o gen = (p for p in srange(2, 10^n) if p.is_perfect_power())
%o return sum(1 for _ in gen)
%o print([A089579(n) for n in range(1, 7)]) # _Peter Luschny_, Sep 15 2023
%o (Python)
%o from sympy import mobius, integer_nthroot
%o def A089579(n): return int(sum(mobius(x)*(1-integer_nthroot(10**n,x)[0]) for x in range(2,(10**n).bit_length())))-1 if n>1 else 3 # _Chai Wah Wu_, Aug 13 2024
%Y Cf. A001597, A070428, A089580, A275358.
%K nonn
%O 1,1
%A _Martin Renner_, Dec 29 2003
%E a(9)-a(10) from _Martin Renner_, Oct 02 2004
%E More terms from _T. D. Noe_, Nov 16 2006
%E More precise name by _Hugo Pfoertner_, Sep 15 2023