OFFSET
1,3
LINKS
Seiichi Manyama, Table of n, a(n) for n = 1..10000
Joerg Arndt, On computing the generalized Lambert series, arXiv:1202.6525v3 [math.CA], (2012).
FORMULA
G.f.: Sum_{k>=2} (-1)^k * (k - 1) * x^k / (1 - x^k).
a(n) = Sum_{d|n} (-1)^d * (d - 1).
Faster converging series: A(q) = Sum_{n >= 1} (-1)^n*q^(n^2)*((n-1)*q^(3*n) + n*q^(2*n) + (n-2)*q^n + n-1)/((1 + q^n)*(1 - q^(2*n))) - apply the operator t*d/dt to equation 1 in Arndt, then set t = -q and x = q. - Peter Bala, Jan 22 2021
a(n) = A128315(n, 2). - G. C. Greubel, Jun 22 2024
MATHEMATICA
nmax = 60; CoefficientList[Series[Sum[x^(2 k)/(1 + x^k)^2, {k, 1, nmax}], {x, 0, nmax}], x] // Rest
Table[Sum[(-1)^d (d - 1), {d, Divisors[n]}], {n, 1, 60}]
PROG
(PARI) {a(n) = sumdiv(n, d, (-1)^d*(d-1))} \\ Seiichi Manyama, Sep 14 2019
(Magma)
A325940:= func< n | (&+[0^(n mod j)*(-1)^j*(j-1): j in [1..n]]) >;
[A325940(n): n in [1..70]]; // G. C. Greubel, Jun 22 2024
(SageMath)
def A325940(n): return sum(0^(n%j)*(-1)^j*(j-1) for j in range(1, n+1))
[A325940(n) for n in range(1, 71)] # G. C. Greubel, Jun 22 2024
CROSSREFS
KEYWORD
sign,look
AUTHOR
Ilya Gutkovskiy, Sep 09 2019
STATUS
approved