login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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 (list; graph; refs; listen; history; text; internal format)
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 * A343903 A339416 A226535
KEYWORD
sign
AUTHOR
Wesley Ivan Hurt, May 13 2020
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 2 03:56 EDT 2024. Contains 372178 sequences. (Running on oeis4.)