Two Related Questions
- Is there any general built-in functionality for computing a sum over solutions to an equation? This is common in number theory. For example, computing sums of the following form...
$$F(n)=\sum_{i+j+k=n}f(i,j,k)$$
where i, j, and k are nonnegative integers.
Note: The above is just an example. I would like to be able to sum over solutions to other simple equations where IntegerPartitions[] does not apply, like $i^2+j+k=n$.
- A related question: How can I sum over a set of sets using the $Sum[]$ function? Because if the answer to question 1 is "no", then I would hope I could still use $Sum[]$ to sum over a set of solutions (sets).
• For example, I know
$$\sum_{i \in \{a,b,c\}}f(i,j)$$
can be computed with
Sum[f[i,j],{i,{a,b,c}}]
giving
$$f[a, j] + f[b, j] + f[c, j]$$
• What I'm looking for is a way for Mathematica to compute
$$\sum_{\{i,j\} \in \{(a,x),(b,y),(c,z)\}}f(i,j)$$
to give
$$f[a, x] + f[b, y] + f[c, z]$$
I would expect/want Mathematica to give that using the code
Sum[f[i,j],{{i,j},{{a,x},{b,y},{c,z}}]
but that gives an error.
Any ideas?