OFFSET
1,2
COMMENTS
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.
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = sigma(n^2) - sigma(n).
a(n) = n^2 iff n is prime. - Altug Alkan, Oct 04 2018
MAPLE
map(n -> numtheory:-sigma(n^2)-numtheory:-sigma(n), [$1..100]); # Robert Israel, Oct 04 2018
MATHEMATICA
Table[DivisorSigma[1, n^2] - DivisorSigma[1, n], {n, 70}] (* Vincenzo Librandi, Oct 05 2018 *)
PROG
(PARI) a(n) = sigma(n^2)-sigma(n)
(Magma) [DivisorSigma(1, n^2) - DivisorSigma(1, n): n in [1..70]]; // Vincenzo Librandi, Oct 05 2018
(Python)
from __future__ import division
from sympy import factorint
def A320059(n):
c1, c2 = 1, 1
for p, a in factorint(n).items():
c1 *= (p**(2*a+1)-1)//(p-1)
c2 *= (p**(a+1)-1)//(p-1)
return c1-c2 # Chai Wah Wu, Oct 05 2018
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Franklin T. Adams-Watters, Oct 04 2018
STATUS
approved