I need to compute the quotient $\frac{n-1}{\sigma(n)-n}$ over the list say $\{9,25,49,81,121,169,...\}$ where $\sigma(.)$ is the classic sum of divisor function.

I tried to use the following codes but it did not work:


What must be the correct code so that I can compute the stated quotient over the given list. Thanks a lot.


closed as off-topic by happy fish, Bob Hanlon, Kuba Mar 9 '17 at 6:45

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – happy fish, Bob Hanlon, Kuba
If this question can be reworded to fit the rules in the help center, please edit the question.

  • $\begingroup$ you need n to be # and & at the end of the function, like in your recent question 139430... $\endgroup$ – Kuba Mar 9 '17 at 6:43
  • $\begingroup$ See ref/Function and linked topics $\endgroup$ – Kuba Mar 9 '17 at 6:44
  • $\begingroup$ Thanks a lot for helping me. @Kuba $\endgroup$ – Jr Antalan Mar 9 '17 at 9:34

What you have applied to the list is not a function. You can do either of the following:

Function[n, ((n - 1)/(DivisorSigma[1, n] - n))] /@ {9, 25, 49, 81, 121, 169}
f[n_] := ((n - 1)/(DivisorSigma[1, n] - n));
f /@ {9, 25, 49, 81, 121, 169}

Not the answer you're looking for? Browse other questions tagged or ask your own question.