Number of solutions for $x[1] + x[2] + \ldots + x[n] =k$ Omg this is driving me crazy seriously, it's a subproblem for a bigger problem, and i'm stuck on it.
Anyways i need the number of ways to pick $x[1]$ ammount of objects type $1$, $x[2]$ ammount of objects type $2$, $x[3]$ ammounts of objects type $3$ etc etc such that $$x[1] + x[2] + \ldots x[n] = k\;.$$ Order of the objects of course doesn't matter.
I know there is a simple formula for this something like $\binom{k + n}n$ or something like that i just can't find it anywhere on google.

$\tbinom{k+n}{n}$ is close...but not quite right:
For any pair of natural numbers $n$ and $k$, the number of distinct n-tuples of non-negative integers whose sum is $k$ is given by the binomial coefficient: $$\displaystyle\binom{n+k+1}{n - 1}= \binom{n + k - 1}{k},\quad \text{ where}\;\quad \binom{n+k-1}k\,=\,\frac{(n+k-1)\,!}{n\,!\,(k-1)\,!}\;$$
Your problem is a version of the classic "stars-and-bars problem" in combinatorics.

See Binomial Coefficient for more information on the very many ways the the binomial coefficient can be used, - when, why, and how it's appropriate for a problem like yours and many others!
