login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A334874
a(n) = sigma(1) - tau(2) + sigma(3) - tau(4) + sigma(5) - tau(6) + ... - (up to n).
4
1, -1, 3, 0, 6, 2, 10, 6, 19, 15, 27, 21, 35, 31, 55, 50, 68, 62, 82, 76, 108, 104, 128, 120, 151, 147, 187, 181, 211, 203, 235, 229, 277, 273, 321, 312, 350, 346, 402, 394, 436, 428, 472, 466, 544, 540, 588, 578, 635, 629, 701, 695, 749, 741, 813, 805, 885, 881, 941, 929
OFFSET
1,3
LINKS
FORMULA
a(n) = Sum_{k=1..n} (-1)^(k+1) * sigma_[k mod 2](k), where sigma_[0](n) = tau(n), the number of divisors of n and sigma_[1](n) = sigma(n), the sum of the divisors of n.
a(p^k) - a(p^k-1) = (p^(k+1)-1)/(p-1), where p is an odd prime and k is a positive integer. - Wesley Ivan Hurt, May 15 2020
EXAMPLE
a(1) = sigma(1) = 1;
a(2) = sigma(1) - tau(2) = 1 - 2 = -1;
a(3) = sigma(1) - tau(2) + sigma(3) = 1 - 2 + 4 = 3;
a(4) = sigma(1) - tau(2) + sigma(3) - tau(4) = 1 - 2 + 4 - 3 = 0;
MAPLE
f:= proc(n) if n::odd then numtheory:-sigma(n) else -numtheory:-tau(n) fi end proc:
ListTools:-PartialSums(map(f, [$1..100])); # Robert Israel, May 15 2020
MATHEMATICA
Table[Sum[(-1)^(k + 1)*DivisorSigma[Mod[k, 2], k], {k, n}], {n, 100}]
PROG
(PARI) a(n) = sum(k=1, n, (-1)^(k+1)*sigma(k, k % 2)); \\ Michel Marcus, May 14 2020
CROSSREFS
Cf. A000005 (tau), A000203 (sigma), A245466.
Sequence in context: A071126 A077187 A011079 * A339416 A226535 A005928
KEYWORD
sign
AUTHOR
Wesley Ivan Hurt, May 13 2020
STATUS
approved