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”).
%I #21 Dec 19 2021 10:26:12
%S 1,1,0,0,-1,0,-1,-2,-2,-1,-1,-2,-2,-3,-2,-3,-1,-4,-2,-5,-4,-3,-1,-6,
%T -3,-4,-3,-5,-1,-6,-3,-7,-5,-5,-3,-7,-1,-5,-3,-6,0,-9,-2,-7,-6,-6,-2,
%U -11,-4,-9,-5,-7,-2,-12,-5,-8,-5,-5,0,-13,-1,-7,-6,-8,-4,-12,-1,-8,-5,-10,-2,-14,-3,-8,-9,-9,-4,-14,-3,-12,-7,-8,-3,-17
%N a(n) = Sum_{k=1..n, gcd(k,n)=1} mu(k), where mu(k) = A008683(k) (the Moebius function).
%e The positive integers <= 10 and coprime to 10 are 1, 3, 7 and 9. So a(10) = mu(1) + mu(3) + mu(7) + mu(9) = 1 - 1 - 1 + 0 = -1.
%t quetMu[n_] := Sum[KroneckerDelta[GCD[i, n], 1] MoebiusMu[i], {i, n}]; Table[quetMu[n], {n, 85}] (* _Alonso del Arte_, Nov 28 2011 *)
%o (PARI) a(n)=sum(k=1,n,if(gcd(n,k)==1,moebius(k),0)) \\ Lambert Herrgesell, Dec 09 2005
%Y Cf. A008683.
%K sign
%O 1,8
%A _Leroy Quet_, Dec 06 2005
%E More terms from Lambert Herrgesell and _Matthew Conroy_, Dec 09 2005