OFFSET
1,3
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
FORMULA
For odd n, a(n) = A018804(n).
Dirichlet g.f.: zeta(s-1)^2*(1 - 2^(1-s))/zeta(s).
Multiplicative with a(2^e)=2^(e-1) for e>0 and a(p^e)=((p-1)*e+p)*p^(e-1) for e>0 and p>2. - Werner Schulte, Feb 04 2018
Sum_{k=1..n} a(k) ~ 3*n^2 / (2*Pi^2) * (log(n) - 1/2 + 2*gamma + log(2) - 6*Zeta'(2)/Pi^2), where gamma is the Euler-Mascheroni constant A001620. - Vaclav Kotesovec, Feb 02 2019
EXAMPLE
a(10)=9 because row 10 of A050873 is gcd(10,k) for k=1,2,...10: 1, 2, 1, 2, 5, 2, 1, 2, 1, 10. If we sum the odd terms in this row we have 1+1+5+1+1=9.
MATHEMATICA
nn = 60; f[list_, i_] := list[[i]]; a =Table[EulerPhi[n], {n, 1, nn}]; b =
Table[If[OddQ[n], n, 0], {n, 1, nn}]; Table[DirichletConvolve[f[a, n], f[b, n], n, m], {m, 1, nn}]
Table[Sum[(d*(1-(-1)^d)/2)*EulerPhi[n/d], {d, Divisors[n]}], {n, 1, 50}] (* Vaclav Kotesovec, Feb 02 2019 *)
f[p_, e_] := p^(e-1) * If[p == 2, 1, (p-1)*e + p]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Apr 30 2023 *)
PROG
(PARI) a(n) = sum(k=1, n, my(g = gcd(n, k)); if (g % 2, g, 0)); \\ Michel Marcus, Feb 05 2018
CROSSREFS
KEYWORD
nonn,mult
AUTHOR
Geoffrey Critzer, Mar 01 2015
STATUS
approved