4

You could find the sum of odd divisors of a number raised to some power in the following way: DivisorSum[n, #^(-2k-1) &, OddQ] You can then use Sum[ ] for summation.


3

If you're only interested in the means and variances of linear combinations of random variables (where the means, variances, and covariances exist), then consider the following. Suppose the means and covariances are $\mu$ $\Sigma$, respectively, then the linear combination of the multivariate random variable $X$ and another known vector $\omega$ of the same ...


3

To incorporate comments, for the sake of completeness: Of the three current suggestions in the comments and answer, Daniel Lichtblau's is fastest: DivisorSigmaPrime // ClearAll; DivisorSigmaPrime[r_, n_Integer] := DivisorSigma[r, NestWhile[#/2 &, n, EvenQ]]; It's literally a divide-and-conquer approach, as dividing out twos removes the even divisors. ...


2

The issue in your code has to do with not leaving proper spaces between the letters you used. Hence, mathematica recognized $n \pi x$ as one variable. A nice way to check this in future computations, is to also observe what happens to the colors of the variables when it did not work and when it works. Do you observe anything? If coded with the proper spaces, ...


1

This is meant to be just an extensive comment, rather than an answer. It requires some very minor modification of the accepted answer here to make it work in this example. Let us assume, that you do NOT want to modify the replacement rule from the link I posted. Hence, you have sumRule1 = Sum[expr1_, iter_List] + Sum[expr2_, iter_List] :> Sum[expr1 ...


Only top voted, non community-wiki answers of a minimum length are eligible