OFFSET
0,2
LINKS
Amiram Eldar, Table of n, a(n) for n = 0..36 (from the b-file at A071172; terms 0..20 from Charles R Greathouse IV)
Gérard P. Michon, On the number of squarefree integers not exceeding N.
FORMULA
a(n)/10^n = (6/Pi^2)*(1+o(1)), cf. A059956.
a(n) = A071172(n) - [n <= 1] where [] is the Iverson bracket. - Chai Wah Wu, Jun 01 2024
EXAMPLE
There are 608 squarefree integers smaller than 1000.
MATHEMATICA
a[n_] := Module[{t=10^n-1}, Sum[MoebiusMu[k]Floor[t/k^2], {k, 1, Sqrt[t]}]]
PROG
(PARI) a(n)=sum(d=1, sqrtint(n=10^n-1), n\d^2*moebius(d)) \\ Charles R Greathouse IV, Nov 14 2012
(PARI) a(n)=my(s); forsquarefree(d=1, sqrtint(n=10^n-1), s += n\d[1]^2 * moebius(d)); s \\ Charles R Greathouse IV, Jan 08 2018
(Python)
from math import isqrt
from sympy import mobius
def A053462(n):
m = 10**n-1
return sum(mobius(k)*(m//k**2) for k in range(1, isqrt(m)+1)) # Chai Wah Wu, Jun 01 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Harvey P. Dale, Aug 01 2001
EXTENSIONS
More terms from Dean Hickerson and Vladeta Jovovic, Aug 06, 2001
One more term from Jud McCranie, Sep 01 2005
a(0)=0 and a(14)-a(17) from Gerard P. Michon, Apr 30 2009
a(18)-a(20) from Charles R Greathouse IV, Jan 08 2018
STATUS
approved