I want to sum over a function of n-tuple like so:
$\sum\limits_{a\leq k_1+k_2+...+k_n\leq b}f(\{k_i\}_{i=1}^{n})$
where each $k_i$ is non-negative, i.e. $k_i\geq0 \;\forall\;i $
An Example:
Say, we want to evaluate $\sum\limits_{2\leq k_1+k_2+k_3\leq5}k_1^{k_1!}k_2^{k_2!}k_3^{k_3!}$
My attempt:
f[k_List]:=Product[Power[k[[i]],Factorial[k[[i]]]],{i,1,Length@k}];
tuplelist[x_,n_]:=Sequence @@ Permutations[Join[#, ConstantArray[0, n - Length@#]]] & /@ IntegerPartitions[x, n];
Total@Table[Total@(f[#]&/@tuplelist[i,3]),{i,2,5}]
(*2248*)
Please suggest if there are ways to modify the existing Sum[]
function or other efficient ways to do this. Looking forward to a variety of techniques!