# Sum of all possible products of elements taken from couples

 P: 1,304 As an expression I think what you want to do is: $\Sigma^{N}_{k=0} (a_{k}(\Sigma^{N}_{i=0} b_{i}))$ I have no idea if there is any way to compute this other than just doing it. EDIT: Nevermind, I see you don't want "sum of all possible products of N+1 elements" but sum of all possible products of a choice of R elements from the N+1 elements. No idea, you're probably going to have to write a program for that.