login

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

Sum of divisors of n^2 that do not divide n.
2

%I #25 Sep 08 2022 08:46:23

%S 0,4,9,24,25,79,49,112,108,199,121,375,169,375,379,480,289,808,361,

%T 919,709,895,529,1591,750,1239,1053,1711,841,2749,961,1984,1681,2095,

%U 1719,3660,1369,2607,2323,3847,1681,5091,1849,4039,3673,3799,2209,6519,2744,5374

%N Sum of divisors of n^2 that do not divide n.

%C sigma(n^2) is always odd, so this sequence has the opposite parity from sigma(n): even if n is a square or twice a square, odd otherwise.

%H Chai Wah Wu, <a href="/A320059/b320059.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) = sigma(n^2) - sigma(n).

%F a(n) = A065764(n) - A000203(n).

%F a(n) = n^2 iff n is prime. - _Altug Alkan_, Oct 04 2018

%p map(n -> numtheory:-sigma(n^2)-numtheory:-sigma(n), [$1..100]); # _Robert Israel_, Oct 04 2018

%t Table[DivisorSigma[1, n^2] - DivisorSigma[1, n], {n, 70}] (* _Vincenzo Librandi_, Oct 05 2018 *)

%o (PARI) a(n) = sigma(n^2)-sigma(n)

%o (Magma) [DivisorSigma(1, n^2) - DivisorSigma(1, n): n in [1..70]]; // _Vincenzo Librandi_, Oct 05 2018

%o (Python)

%o from __future__ import division

%o from sympy import factorint

%o def A320059(n):

%o c1, c2 = 1, 1

%o for p, a in factorint(n).items():

%o c1 *= (p**(2*a+1)-1)//(p-1)

%o c2 *= (p**(a+1)-1)//(p-1)

%o return c1-c2 # _Chai Wah Wu_, Oct 05 2018

%Y Cf. A000203, A065764, A072861, A054785.

%K nonn,look

%O 1,2

%A _Franklin T. Adams-Watters_, Oct 04 2018