DivisorSigma
[k, n]For reference, let us first get the integer divisors of 20:
Divisors[20]
The DivisorSigma function counts this sum:
DivisorSigma[1, 20]
This is the same thing as:
DivisorSum[20, # &]
To get a sum of the second power of the factors of 20:
DivisorSigma[2, 20]
Doing this with DivisorSum
instead:
DivisorSum[20, #^2 &]
See also DivisorSum
and Divisors.