login
Number of positive squarefree integers less than 10^n.
9

%I #52 Jun 02 2024 12:57:03

%S 0,6,61,608,6083,60794,607926,6079291,60792694,607927124,6079270942,

%T 60792710280,607927102274,6079271018294,60792710185947,

%U 607927101854103,6079271018540405,60792710185403794,607927101854022750,6079271018540280875,60792710185402613302

%N Number of positive squarefree integers less than 10^n.

%H Amiram Eldar, <a href="/A053462/b053462.txt">Table of n, a(n) for n = 0..36</a> (from the b-file at A071172; terms 0..20 from Charles R Greathouse IV)

%H GĂ©rard P. Michon, <a href="http://www.numericana.com/answer/counting.htm#euler193">On the number of squarefree integers not exceeding N</a>.

%F a(n)/10^n = (6/Pi^2)*(1+o(1)), cf. A059956.

%F a(n) = A071172(n) - [n <= 1] where [] is the Iverson bracket. - _Chai Wah Wu_, Jun 01 2024

%e There are 608 squarefree integers smaller than 1000.

%t a[n_] := Module[{t=10^n-1}, Sum[MoebiusMu[k]Floor[t/k^2], {k, 1, Sqrt[t]}]]

%o (PARI) a(n)=sum(d=1,sqrtint(n=10^n-1), n\d^2*moebius(d)) \\ _Charles R Greathouse IV_, Nov 14 2012

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

%o (Python)

%o from math import isqrt

%o from sympy import mobius

%o def A053462(n):

%o m = 10**n-1

%o return sum(mobius(k)*(m//k**2) for k in range(1, isqrt(m)+1)) # _Chai Wah Wu_, Jun 01 2024

%Y Cf. A005117, A013928.

%Y Cf. A059956, A063035.

%Y Apart from initial term, same as A071172.

%Y Binary counterpart is A143658. - _Gerard P. Michon_, Apr 30 2009

%K nonn

%O 0,2

%A _Harvey P. Dale_, Aug 01 2001

%E More terms from _Dean Hickerson_ and _Vladeta Jovovic_, Aug 06, 2001

%E One more term from _Jud McCranie_, Sep 01 2005

%E a(0)=0 and a(14)-a(17) from _Gerard P. Michon_, Apr 30 2009

%E a(18)-a(20) from _Charles R Greathouse IV_, Jan 08 2018