Iterate over indices in multinominal expansion
Context: In the multinominal expansion, the valid indices [k1, k2, … kr] for each term fulfill the equation n = k1 + k2 + … + kr. Given r and n, I’m trying to iterate over all terms. For that, I need a way to get every valid index set.
Loop over indixes in multinominal coefficients
Context: In the multinominal coefficient, the valid indices [k1,k2,…kr] for each term fulfill the equation n=k1+k2+…+kr. Given r and n, I’m trying to iterate over all terms. For that, I need a way to get every valid index set.