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

Number of numbers <= n that are either squarefree, a divisor of n, or both.
0

%I #6 Jul 03 2023 10:06:57

%S 1,2,3,4,4,5,6,8,7,7,8,10,9,10,11,14,12,14,13,15,14,15,16,20,17,17,19,

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

%U 32,34,33,37,34,38,35,36,37,41,38,39,41,44,40,41,42,44,43,44,45,53,46,47,49

%N Number of numbers <= n that are either squarefree, a divisor of n, or both.

%F a(n) = tau(n) + Sum_{k=1..n} mu(k)^2 - Sum_{d|n} mu(d)^2.

%F a(n) = A000005(n) + A013928(n+1) - A034444(n).

%e a(10) = 7; There are 7 numbers less than or equal to 10 that are either squarefree, a divisor of 10, or both. The numbers are 1,2,3,5,6,7,10.

%t Module[{nn=80,sf},sf=Select[Range[nn],SquareFreeQ[#]&];Table[Length[Union[Select[sf,#<= n&],Divisors[n]]],{n,nn}]] (* _Harvey P. Dale_, Jul 03 2023 *)

%Y Cf. A000005 (tau), A013928, A034444.

%K nonn

%O 1,2

%A _Wesley Ivan Hurt_, Feb 12 2022