login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A377934
a(n) is the number of perfect powers m^k with k>=3 (A076467) <= 10^n.
2
1, 2, 7, 17, 38, 75, 152, 306, 616, 1260, 2598, 5401, 11307, 23798, 50316, 106776, 227236, 484737, 1036002, 2217529, 4752349, 10194727, 21887147, 47020054, 101065880, 217325603, 467484989, 1005881993, 2164843035, 4660016778, 10032642455, 21602193212, 46518438071
OFFSET
0,2
FORMULA
a(n) = 10^n - Sum_{k=1..floor(log2(10^n))} mu(k)*(floor(10^(n/k))+floor(10^(n/(2k)))-2). - Chai Wah Wu, Nov 24 2024
EXAMPLE
a(0) = 1: 1^k with any k>2 (<= 10^0);
a(1) = 2: 1 and 2^3 (<=10^1);
a(2) = 7: 2 powers <= 10 and 16, 27, 32, 64, 81 (<=10^2).
PROG
(Python)
from math import gcd
from sympy import integer_nthroot, mobius
def A377934(n): return int(integer_nthroot(10**(n//(a:=gcd(n, 4))), 4//a)[0]-sum(mobius(k)*(integer_nthroot(10**(n//(b:=gcd(n, k))), k//b)[0]+integer_nthroot(10**(n//(c:=gcd(n, d:=k<<1))), d//c)[0]-2) for k in range(3, (10**n).bit_length()))) # Chai Wah Wu, Nov 24 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Hugo Pfoertner, Nov 24 2024
EXTENSIONS
a(28) onwards from Chai Wah Wu, Nov 24 2024
STATUS
approved