login
a(n) = Sum_{d|n} (-1)^omega(n/d) * d.
2

%I #38 May 01 2020 07:51:40

%S 1,1,2,1,4,2,6,1,5,4,10,2,12,6,8,1,16,5,18,4,12,10,22,2,19,12,14,6,28,

%T 8,30,1,20,16,24,5,36,18,24,4,40,12,42,10,20,22,46,2,41,19,32,12,52,

%U 14,40,6,36,28,58,8,60,30,30,1,48,20,66,16,44,24,70,5,72

%N a(n) = Sum_{d|n} (-1)^omega(n/d) * d.

%C If n is squarefree (A005117), then a(n) = A000010(n) where A000010 is the Euler totient function.

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

%F a(n) = n * Sum_{d|n} A076479(d)/d.

%F Sum_{k=1..n} a(k) ~ A065469 * n*(n+1)/2.

%F Multiplicative with a(p^e) = p^e - (p^e - 1)/(p-1).

%F a(n) = Sum_{d|n} mu(d)*tau(d)*sigma(n/d). - _Ridouane Oudra_, Nov 24 2019

%F a(n) = Sum_{d|n} A058026(d). - _Amiram Eldar_, May 01 2020

%p with(numtheory): omega := n -> nops(factorset(n)):

%p seq(add((-1)^omega(n/d)*d, d in divisors(n)), n=1..100); # _Ridouane Oudra_, Nov 24 2019

%t f[p_, e_] := p^e - (p^e - 1)/(p - 1); a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* _Amiram Eldar_, May 01 2020 *)

%o (PARI) a(n) = sumdiv(n, d, (-1)^omega(n/d) * d);

%o (PARI) a(n) = my(f=factor(n)); prod(k=1, #f~, f[k,1]^f[k,2] - (f[k,1]^f[k,2] - 1)/(f[k,1]-1));

%Y Cf. A058026, A065469, A076479, A206369.

%K nonn,mult

%O 1,3

%A _Daniel Suteu_, Apr 05 2019