login
Sum of the squarefree divisors of n whose square does not divide n.
3

%I #36 Oct 13 2023 06:54:14

%S 0,2,3,0,5,11,7,0,0,17,11,9,13,23,23,0,17,8,19,15,31,35,23,9,0,41,0,

%T 21,29,71,31,0,47,53,47,0,37,59,55,15,41,95,43,33,20,71,47,9,0,12,71,

%U 39,53,8,71,21,79,89,59,69,61,95,28,0,83,143,67,51,95,143,71,0,73

%N Sum of the squarefree divisors of n whose square does not divide n.

%H Amiram Eldar, <a href="/A344137/b344137.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) = Sum_{d|n} d * mu(d)^2 * c(n/d^2), where c(n) = ceiling(n) - floor(n).

%F a(n) = A048250(n) - A295295(n). - _Amiram Eldar_, Oct 13 2023

%e a(20) = Sum_{d|20} d * mu(d)^2 * c(20/d^2) = 1*1*0 + 2*1*0 + 4*0*1 + 5*1*1 + 10*1*1 + 20*0*1 = 15.

%t a[n_] := DivisorSum[n, # &, SquareFreeQ[#] && ! Divisible[n, #^2] &]; Array[a, 100] (* _Amiram Eldar_, Oct 13 2023 *)

%o (PARI) a(n) = {my(f = factor(n)); prod(i = 1, #f~, f[i, 1] + 1) - prod(i = 1, #f~, if(f[i, 2] == 1, 1, f[i, 1] + 1));} \\ _Amiram Eldar_, Oct 13 2023

%Y Cf. A048250, A295295, A345320.

%K nonn,easy

%O 1,2

%A _Wesley Ivan Hurt_, Jun 16 2021