cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

Original entry on oeis.org

1, -1, -2, 3, -4, -4, -6, -5, 7, -6, -10, -8, -12, -8, -12, 11, -16, -13, -18, -12, -16, -12, -22, -16, 21, -14, -20, -18, -28, -22, -30, -21, -24, -18, -32, 25, -36, -20, -28, -24, -40, -32, -42, -30, -36, -24, -46, -32, 43
Offset: 1

Views

Author

Reinhard Zumkeller, May 18 2002

Keywords

Examples

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

Crossrefs

Programs

  • Mathematica
    Table[Total[Times@@@Partition[Riffle[Divisors[n],{1,-1},{2,-1,2}],2]],{n,50}] (* Harvey P. Dale, Nov 05 2014 *)

Formula

a(n) = A071324(n) > 0 iff n square (iff A000005(n) is even), a(A000290(n)) > 0.
For primes p, a(p) = 1 - p.
From Shreyansh Jaiswal, Mar 04 2025: (Start)
a(n) = -A071324(n) < 0 iff n is nonsquare.
abs(a(n)) = A071324(n). (End)