(x1 + ... + xk)^N summed over every composition n1 + ... + nk = N of C(N; n1,...,nk) x1^n1 ... xk^nk, eq (1.38), with the multinomial coefficient of eq (1.37). The total is cross-checked against the direct power.
References
Morin, D. J. (2016). Probability: For the Enthusiastic Beginner. Createspace. Eqs. (1.37)-(1.38).
Examples
MultiExp(c(1, 1, 1), 4)$n_terms
#> [1] 15
