I would like to write a function that would, given a positive integer $n$, compute the following:
$S_n = \sum_{(x,y,z)} a_{(x,y,z)} f(x,y,z)$, where the sum runs over all tuples $(x,y,z)$ such that $x+y+z = n$, and $x,y,z$ take values in {$0,1,...,n$}. The ultimate goal is to pass this function trough Solve
to determine the coefficients $a_{(x,y,z)}$ with some other conditions from the problem.
My main problem is generating the appropriate tuples in a way that I could then pass through Sum
.
Any help is appreciated.
FrobeniusSolve[]
? $\endgroup$FrobeniusSolve[ConstantArray[1, n], n]
would do; but if you can make any use of permutational equivalence, thenIntegerPartitions[n, {n}, Range[0, n]]
may also help as it generates a vastly smaller list (which needs to be permuted, however). $\endgroup$