login
Number of squarefree numbers between n and 2*n (inclusive).
8

%I #15 Mar 03 2021 04:21:46

%S 2,2,3,3,4,4,5,5,6,7,8,8,9,8,9,9,11,11,13,13,15,15,15,15,15,16,16,17,

%T 19,19,20,19,21,21,22,22,24,23,24,24,25,25,26,26,27,28,29,29,30,30,32,

%U 32,34,34,36,36,38,38,38,38,39,39,38,39,41,41,42,41,43,43,44,44,46,45,45

%N Number of squarefree numbers between n and 2*n (inclusive).

%H Charles R Greathouse IV, <a href="/A179211/b179211.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) = Sum_{k=n..2*n} A008966(k).

%F a(n) > A035250(n) for n>2;

%F A179212(n) = a(n+1) - a(n);

%F a(n) = A013928(2*n+1) - A013928(n).

%F a(n) ~ (6/Pi^2) * n. - _Amiram Eldar_, Mar 03 2021

%p a := n -> nops(select(issqrfree, [$n..(2*n)])):

%p seq(a(n), n=1..75); # _Peter Luschny_, Mar 02 2017

%t a[n_] := Select[Range[n, 2n], SquareFreeQ] // Length;

%t Array[a, 75] (* _Jean-François Alcover_, Jun 22 2018 *)

%o (PARI) f(n)=my(s); forfactored(k=1,sqrtint(n), s += n\k[1]^2*moebius(k)); s

%o a(n)=f(2*n)-f(n-1) \\ _Charles R Greathouse IV_, Nov 05 2017

%Y Cf. A005117, A008966, A013928, A035250, A061398, A179212, A179213, A179214.

%K nonn

%O 1,1

%A _Reinhard Zumkeller_, Jul 05 2010