I'd like to ask for an extension of Nicolau Saker Neto's answer here: What is the relative size of the (M+2) peak?
I'm trying to calculate isotopic abundances of molecules with more than 2 isotopes. I've been experimenting calculating relative abundances involving $\ce{^{16}O}, \ce{^{17}O}$ , and $\ce{^{18}O} $ across $\ce{O_3}$ and $\ce{O_4}$. I've been googling and looking through books and haven't found any direct examples of someone doing this.
Laid out in the same format, and using $m_{16}$ to indicate the mass of $\ce{^{16}O}$, etc.:
$$\begin{align} (0.9976m_{16} + 0.0004m_{17} + 0.002m_{18})^3 ={} & \ \ \ \ \ \binom {3} {0}(0.9976 m_{16})^3 \\[5pt] & + \binom {3} {1}(0.9976 m_{16})^2 (0.002 m_{18}) \\[5pt] & + \binom {3} {1}(0.9976 m_{16})^2 (0.0004 m_{17}) \\[5pt] & + \binom {3} {2}(0.9976 m_{16}) (0.002 m_{18})^2 \\[5pt] & + \binom {3} {2}(0.9976 m_{16}) (0.0004 m_{17})^2 \\[5pt] & + \binom {3} {2}(0.0004 m_{17}) (0.002 m_{18})^2 \\[5pt] & + \binom {3} {2}(0.002 m_{18}) (0.0004 m_{17})^2 \\[5pt] ... \\[5pt] & + \binom {?} {?}(0.9976 m_{16}) (0.0004 m_{17}) (0.002 m_{18}) \\ \end{align}$$
My real issue is with the factors involving the binomial for the triple-combination. Which I guess is a polynomial instead of a binomial. I know for sure the value multiplied by the product of % abundances should be 6. But I'm not understanding the logic behind why it's 6.
From what I understand, multiplying binomials is akin to to squaring them, but that would mean this would be 3 choose 1 squared, which is 9. Multiplying them could make sense if the second binomial had an $(n-1)$ for its upper value, this would give you 3*2. This makes sense as long as you approach the largest number first.
The above logic holds well until I test it on $\ce{O_4}$, where it seems to be too naive whenever all 3 isotopes are present.
I'm using a symbolic math solver to brute-force solve these to check my answers. The source of error is obviously coming from the binomial/polynomial term. Is there a proper way to calculate that for a molecule when $n$ different isotopes of the same element are present?