Statement of the problem:
The divisors of 6 are 1,2,3 and 6. The sum of the squares of these numbers is:
1 + 4 + 9 + 9 + 36 = 50
Allow sigma2(n)
to represent the sum of the squares of the n-dividers.
Thus, sigma2(6) = 50
.
And addition_sigma2 (n)
is the sum of all sigma2, smaller than or equal to n. For example,
addition_sigma2(6) = 113
This is what I have programmed in Maxima:
sigma2(n) :=
divsum(n,2)$
addition_sigma2(n) :=
lreduce("+", makelist(sigma2(k), k, 1, n))$
But, it's very inefficient. Well, I need to calculate addition_sigma2(10^17)
and my algorithm is not able to calculate it. Can you think of any improvements?