login
A333493
a(n) = Sum_{k=1..n} (-1)^(k+1) * lcm(n,k) / gcd(n,k).
0
1, 1, -2, 13, -9, 28, -20, 109, -11, 151, -54, 256, -77, 442, 48, 877, -135, 757, -170, 1363, 103, 1816, -252, 2080, -59, 3043, -38, 3982, -405, 2878, -464, 7021, 273, 6937, 390, 6817, -665, 9748, 388, 11059, -819, 8407, -902, 16348, 219, 17458, -1080, 16672, -167
OFFSET
1,3
FORMULA
If n odd, a(n) = (1/2) * n * Sum_{d|n} Sum_{j|d} (-1)^(j + 1) * mu(d/j) * (n + d) / j^2.
If n even, a(n) = (1/2) * n^2 * Sum_{d|n} Sum_{j|d} (-1)^(j + 1) * mu(d/j) * (n + d) / (d * j^2).
MATHEMATICA
Table[Sum[(-1)^(k + 1) LCM[n, k]/GCD[n, k], {k, 1, n}], {n, 1, 49}]
PROG
(PARI) a(n) = sum(k=1, n, (-1)^(k+1)*lcm(n, k)/gcd(n, k)); \\ Michel Marcus, Mar 24 2020
CROSSREFS
Alternating row sums of A051537.
Sequence in context: A124869 A292007 A213825 * A244932 A157480 A342953
KEYWORD
sign
AUTHOR
Ilya Gutkovskiy, Mar 24 2020
STATUS
approved