OFFSET
1,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..10000
László Tóth, Multiplicative arithmetic functions of several variables: a survey, arXiv:1310.7053 [math.NT], 2013-2014.
FORMULA
Multiplicative with a(p) = 2*p, a(p^k) = (2*p^(k+1) - p^ceiling((k+1)/2) - p^floor((k+1)/2)) / (p-1). a(n) is odd iff n is an odd square. - Henry Bottomley, May 16 2005
Multiplicative with a(p^e) = Sum_{k=0..e} p^max(k, e-k), (cf. A107661). - Mitch Harris, May 18 2005
Dirichlet g.f.: (zeta(s-1))^2*zeta(2s-1)/zeta(2s-2). - R. J. Mathar, Feb 11 2011
Sum_{k=1..n} a(k) ~ 3*zeta(3)*n^2 / (2*Pi^2) * (2*log(n) - 24*zeta'(2)/Pi^2 - 1 + 4*gamma + 4*zeta'(3)/zeta(3)), where gamma is the Euler-Mascheroni constant A001620. - Vaclav Kotesovec, Feb 01 2019
EXAMPLE
a(8) = lcm(1,8) + lcm(2,4) + lcm(4,2) + lcm(8,1) = 8 + 4 + 4 + 8 = 24.
MATHEMATICA
Table[DivisorSum[n, LCM[#, n/#] &], {n, 59}] (* Michael De Vlieger, Dec 11 2017 *)
f[p_, e_] := (2*p^(e + 1) - p^Ceiling[(e + 1)/2] - p^Floor[(e + 1)/2])/(p - 1); f[p_, 1] := 2*p; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 60] (* Amiram Eldar, Aug 27 2023 *)
PROG
(PARI) a(n) = sumdiv(n, d, lcm(d, n/d)); \\ Michel Marcus, May 19 2014
CROSSREFS
KEYWORD
nonn,mult,easy
AUTHOR
Leroy Quet, Oct 18 2000
STATUS
approved