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
Robert Israel, Table of n, a(n) for n = 1..10000
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)
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
CROSSREFS
KEYWORD
AUTHOR
Ilya Gutkovskiy, Oct 09 2019
STATUS
approved