login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Alternating sum of all divisors of n; divisors nondecreasing, starting with 1.
4

%I #9 Dec 12 2015 04:17:56

%S 1,-1,-2,3,-4,-4,-6,-5,7,-6,-10,-8,-12,-8,-12,11,-16,-13,-18,-12,-16,

%T -12,-22,-16,21,-14,-20,-18,-28,-22,-30,-21,-24,-18,-32,25,-36,-20,

%U -28,-24,-40,-32,-42,-30,-36,-24,-46,-32,43

%N Alternating sum of all divisors of n; divisors nondecreasing, starting with 1.

%C a(n)>0 iff n square (iff A000005(n) is even), a(A000290(n))>0;

%C for primes p: a(p) = 1 - p.

%H Harvey P. Dale, <a href="/A071323/b071323.txt">Table of n, a(n) for n = 1..1000</a>

%e Divisors of 20 are {1,2,4,5,10,20}, therefore a(20) = 1 - 2 + 4 - 5 + 10 - 20 = -12.

%t Table[Total[Times@@@Partition[Riffle[Divisors[n],{1,-1},{2,-1,2

%t }],2]],{n,50}] (* _Harvey P. Dale_, Nov 05 2014 *)

%Y Cf. A000203, A071321, A071324.

%K sign

%O 1,3

%A _Reinhard Zumkeller_, May 18 2002