login
Number of squarefree numbers that are less than n, not dividing n, and relatively prime to n.
1

%I #7 Jan 06 2024 00:28:41

%S 0,0,1,1,2,1,4,3,3,2,6,3,7,4,5,6,10,5,11,6,7,8,14,7,12,9,12,8,16,7,18,

%T 12,12,12,14,10,22,14,16,13,25,10,27,16,17,17,29,14,25,16,20,18,31,15,

%U 24,19,22,22,35,14,36,24,25,25,29,17,40,25,28,21,43,21,44

%N Number of squarefree numbers that are less than n, not dividing n, and relatively prime to n.

%F a(n) = Sum_{k=1..n} mu(k)^2 * floor(1/gcd(n,k)) * (ceiling(n/k) - floor(n/k)).

%e a(7) = 4. There are 4 squarefree numbers that are less than 7, do not divide 7, and relatively prime to 7: namely {2, 3, 5, 6}, so a(7) = 4.

%t Table[Sum[MoebiusMu[k]^2*Floor[1/GCD[n, k]] (Ceiling[n/k] - Floor[n/k]), {k, n}], {n, 80}]

%Y Cf. A008683 (mu), A368706.

%K nonn,easy

%O 1,5

%A _Wesley Ivan Hurt_, Jan 03 2024