login
A199806
Alternating LCM-sum: a(n) = Sum_{k=1..n} (-1)^(k-1)*lcm(k,n).
2
1, 0, 0, 8, -5, 18, -14, 80, -9, 100, -44, 204, -65, 294, 30, 672, -119, 540, -152, 1040, 63, 1210, -230, 1752, -75, 2028, -54, 2996, -377, 2190, -434, 5440, 165, 4624, 280, 5472, -629, 6498, 234, 8800, -779, 6300, -860, 12188, 225, 11638, -1034, 14256, -245, 13000
OFFSET
1,4
LINKS
Laszlo Toth, Weighted gcd-sum functions, J. Integer Sequences, 14 (2011), Article 11.7.7
MATHEMATICA
Table[Sum[(-1)^(k-1) LCM[k, n], {k, n}], {n, 50}] (* Harvey P. Dale, Jan 30 2024 *)
PROG
(Sage)
def A199806(n) : return add((-1)^(k-1)*lcm(k, n) for k in (1..n))
[A199806(n) for n in (1..50)] # Peter Luschny, Nov 10 2011
(PARI) a(n)=-sum(k=1, n, (-1)^k*lcm(k, n)) \\ Charles R Greathouse IV, Nov 10 2011
(Magma) [&+[(-1)^(k-1)*Lcm(k, n):k in [1..n]]: n in [1..50]]; // Marius A. Burtea, Oct 02 2019
CROSSREFS
Sequence in context: A347902 A253806 A348688 * A070484 A096480 A248292
KEYWORD
sign
AUTHOR
Laszlo Toth, Nov 10 2011
STATUS
approved