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

A328258
a(n) = Sum_{d|n, gcd(d,n/d) = 1} (-1)^(d + 1) * d.
4
1, -1, 4, -3, 6, -4, 8, -7, 10, -6, 12, -12, 14, -8, 24, -15, 18, -10, 20, -18, 32, -12, 24, -28, 26, -14, 28, -24, 30, -24, 32, -31, 48, -18, 48, -30, 38, -20, 56, -42, 42, -32, 44, -36, 60, -24, 48, -60, 50, -26, 72, -42, 54, -28, 72, -56, 80, -30, 60, -72, 62, -32, 80, -63, 84
OFFSET
1,3
COMMENTS
Excess of sum of odd unitary divisors of n over sum of even unitary divisors of n.
a(n) = n+1 iff n is in A061345 \ {1}. - Bernard Schott, Mar 05 2023
LINKS
Eric Weisstein's World of Mathematics, Unitary Divisor.
FORMULA
If n = Product (p_j^k_j) then a(n) = Product (1 - (-1)^p_j * p_j^k_j).
If n odd, a(n) = usigma(n), where usigma = A034448.
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
From Amiram Eldar, Jan 28 2023: (Start)
a(n) = 2 * A192066(n) - A034448(n).
a(n) = A192066(n) - A360156(n/2) if n is even, and A192066(n) otherwise.
Dirichlet g.f.: (zeta(s)*zeta(s-1)/zeta(2*s-1))*(2^(2*s)-2^(s+2)+2)/(2^(2*s)-2). (End)
MAPLE
f:= proc(n) local t;
mul(1 - (-1)^t[1] * t[1]^t[2], t=ifactors(n)[2])
end proc:
map(f, [$1..100]); # Robert Israel, Oct 10 2019
MATHEMATICA
a[n_] := Sum[Boole[GCD[d, n/d] == 1] (-1)^(d + 1) d, {d, Divisors[n]}]; Table[a[n], {n, 1, 65}]
a[1] = 1; a[n_] := Times @@ (1 - (-1)^First[#] First[#]^Last[#] & /@ FactorInteger[n]); Table[a[n], {n, 1, 65}]
PROG
(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
(PARI) a(n) = sumdiv(n, d, if (gcd(d, n/d) == 1, (-1)^(d + 1) * d)); \\ Michel Marcus, Oct 10 2019
KEYWORD
sign,mult,look
AUTHOR
Ilya Gutkovskiy, Oct 09 2019
STATUS
approved