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”).

A378168
a(n) is the number of squares <= 10^n that are not higher powers, i.e., terms of A076467.
3
2, 6, 24, 87, 292, 959, 3089, 9875, 31410, 99633, 315589, 998889, 3160340, 9996605, 31616816, 99989509, 316209268, 999967330, 3162219896, 9999897769, 31622595517, 99999679010, 316227196708, 999998989804, 3162275866962, 9999996815862, 31622770946248, 99999989953079
OFFSET
1,1
FORMULA
a(n) = Sum_{k=1..floor(log_2(10^n)-1)} mu(k)*floor(10^(n/(2k))-1). - Chai Wah Wu, Nov 20 2024
EXAMPLE
a(1) = 2: squares <= 10 are 2^2 and 3^2;
a(2) = 6: 2 squares <= 10 and 5^2, 6^2, 7^2, 10^2, but not 4^2=2^4, 8^2=2^6, and 9^2=3^4;
a(3) = 24: 6 squares <= 100 and all squares between 11^2 and 31^2, except for 16^2=2^8, 25^2=5^4, and 27^2=3^6.
MATHEMATICA
Table[Sum[MoebiusMu[k]*Floor[10^(n/(2k))-1], {k, Floor[Log2[10^n]-1]}], {n, 28}] (* James C. McMahon, Nov 21 2024 *)
PROG
(Python)
from math import gcd
from sympy import integer_nthroot, mobius
def A378168(n): return sum(mobius(k)*(integer_nthroot(10**(n//(a:=gcd(n, b:=k<<1))), b//a)[0]-1) for k in range(1, (10**n).bit_length()-1)) # Chai Wah Wu, Nov 20 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Hugo Pfoertner, Nov 20 2024
EXTENSIONS
a(20) onwards from Chai Wah Wu, Nov 20 2024
STATUS
approved