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 #27 Mar 06 2023 10:24:21
%S 1,-1,4,-3,6,-4,8,-7,10,-6,12,-12,14,-8,24,-15,18,-10,20,-18,32,-12,
%T 24,-28,26,-14,28,-24,30,-24,32,-31,48,-18,48,-30,38,-20,56,-42,42,
%U -32,44,-36,60,-24,48,-60,50,-26,72,-42,54,-28,72,-56,80,-30,60,-72,62,-32,80,-63,84
%N a(n) = Sum_{d|n, gcd(d,n/d) = 1} (-1)^(d + 1) * d.
%C Excess of sum of odd unitary divisors of n over sum of even unitary divisors of n.
%C a(n) = n+1 iff n is in A061345 \ {1}. - _Bernard Schott_, Mar 05 2023
%H Robert Israel, <a href="/A328258/b328258.txt">Table of n, a(n) for n = 1..10000</a>
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/UnitaryDivisor.html">Unitary Divisor</a>.
%F If n = Product (p_j^k_j) then a(n) = Product (1 - (-1)^p_j * p_j^k_j).
%F If n odd, a(n) = usigma(n), where usigma = A034448.
%F Sum_{k=1..n} a(k) ~ c * n^2, where c = zeta(2)/(14*zeta(3)) = A306633 / 14 = 0.0977451... . - _Amiram Eldar_, Nov 17 2022
%F From _Amiram Eldar_, Jan 28 2023: (Start)
%F a(n) = 2 * A192066(n) - A034448(n).
%F a(n) = A192066(n) - A360156(n/2) if n is even, and A192066(n) otherwise.
%F Dirichlet g.f.: (zeta(s)*zeta(s-1)/zeta(2*s-1))*(2^(2*s)-2^(s+2)+2)/(2^(2*s)-2). (End)
%p f:= proc(n) local t;
%p mul(1 - (-1)^t[1] * t[1]^t[2], t=ifactors(n)[2])
%p end proc:
%p map(f, [$1..100]); # _Robert Israel_, Oct 10 2019
%t a[n_] := Sum[Boole[GCD[d, n/d] == 1] (-1)^(d + 1) d, {d, Divisors[n]}]; Table[a[n], {n, 1, 65}]
%t a[1] = 1; a[n_] := Times @@ (1 - (-1)^First[#] First[#]^Last[#] & /@ FactorInteger[n]); Table[a[n], {n, 1, 65}]
%o (Magma) [&+[(-1)^(d+1)*d:d in Divisors(n)|Gcd(d, n div d) eq 1]:n in [1..70]]; // _Marius A. Burtea_, Oct 10 2019
%o (PARI) a(n) = sumdiv(n, d, if (gcd(d,n/d) == 1, (-1)^(d + 1) * d)); \\ _Michel Marcus_, Oct 10 2019
%Y Cf. A002129, A034448, A077610, A109712, A192066, A254503, A306633, A360156.
%K sign,mult,look
%O 1,3
%A _Ilya Gutkovskiy_, Oct 09 2019