OFFSET
1,2
LINKS
Akshay Bansal, Table of n, a(n) for n = 1..10000 (terms 1..1000 from T. D. Noe)
Akshay Bansal, C Program.
Soichi Ikeda and Kaneaki Matsuoka, On the Lcm-Sum Function, Journal of Integer Sequences, Vol. 17 (2014), Article 14.1.7.
László Tóth, Weighted gcd-sum functions, J. Integer Sequences, 14 (2011), Article 11.7.7.
FORMULA
a(n) = n*(1+Sum_{d|n} d*phi(d))/2 = n*(1+A057660(n))/2 = n*A057661(n). - Vladeta Jovovic, Jun 21 2002
G.f.: x*f'(x), where f(x) = x/(2*(1 - x)) + (1/2)*Sum_{k>=1} k*phi(k)*x^k/(1 - x^k) and phi() is the Euler totient function (A000010). - Ilya Gutkovskiy, Aug 31 2017
Sum_{k=1..n} a(k) ~ 3 * zeta(3) * n^4 / (4*Pi^2). - Vaclav Kotesovec, May 29 2021
MAPLE
a:=n->add(ilcm( n, j ), j=1..n): seq(a(n), n=1..50); # Zerinvary Lajos, Nov 07 2006
MATHEMATICA
Table[Sum[LCM[k, n], {k, 1, n}], {n, 1, 39}] (* Geoffrey Critzer, Feb 16 2015 *)
f[p_, e_] := (p^(2*e + 1) + 1)/(p + 1); a[n_] := n * (1 + Times @@ f @@@ FactorInteger[n])/2; Array[a, 100] (* Amiram Eldar, Apr 26 2023 *)
PROG
(Haskell)
a051193 = sum . a051173_row -- Reinhard Zumkeller, Feb 11 2014
(PARI) a(n) = sum(k=1, n, lcm(n, k)); \\ Michel Marcus, Feb 06 2015
(Python)
from math import prod
from sympy import factorint
def A051193(n): return n*(1+prod((p**((e<<1)+1)+1)//(p+1) for p, e in factorint(n).items())>>1) # Chai Wah Wu, Aug 05 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved