OFFSET
1,6
COMMENTS
The number of terms where the sum of the odd parts is greater than the sum of the even parts up to 10^n: 6, 57, 521, 5070, 50223, 500707, 5002236, ...
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..65537
FORMULA
G.f.: Sum_{k>0} -(-1)^k * k * x^(2*k) / (1 - x^k). - Michael Somos, Aug 21 2005
EXAMPLE
a(28) = -12 because the sum of the even divisors of 28 (2, 4 and 14) = 20 and the sum of the odd divisors of 28 (1 and 7) = 8.
G.f. = x^2 + x^3 - x^4 + x^5 + 2*x6 + x^7 - 5*x^8 + 4*x^9 + 4*x^10 + x^11 + ...
MATHEMATICA
f[n_Integer] := Block[{d = Most[Divisors[n]]}, Plus @@ (-d*(-1)^d)]; Table[ f[n], {n, 81}] (* or *)
Rest[ CoefficientList[ Series[ Sum[ -(-1)^k*k*x^(2k)/(1 - x^k), {k, 100}], {x, 0, 81}], x]] (* Robert G. Wilson v, Aug 26 2005 *)
Table[With[{d=Most[Divisors[n]]}, Total[Select[d, OddQ]]-Total[Select[d, EvenQ]]], {n, 90}] (* Harvey P. Dale, Feb 16 2013 *)
PROG
(PARI) {a(n) = if(n<1, 0, sumdiv(n, d, (d<n)* d * -(-1)^d))}; /* Michael Somos, Aug 21 2005 */
(PARI) {a(n) = if( n<1, 0, polcoeff( sum(k=1, n\2, -(-1)^k * k * x^(2*k) / (1 - x^k), x * O(x^n)), n))}; /* Michael Somos, Aug 21 2005 */
CROSSREFS
KEYWORD
sign,look
AUTHOR
Robert G. Wilson v, Dec 14 2000
EXTENSIONS
Signs added by Michael Somos, Aug 21 2005
STATUS
approved